Last modified: 2014-07-24 12:58:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57169, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55169 - Reading Templates within Templates
Reading Templates within Templates
Status: RESOLVED INVALID
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-05 04:37 UTC by Kunal Mehta (Legoktm)
Modified: 2014-07-24 12:58 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kunal Mehta (Legoktm) 2013-10-05 04:37:02 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1525/
Reported by: Anonymous user
Created on: 2012-10-24 04:53:20
Subject: Reading Templates within Templates
Assigned to: xqt
Original description:
Hi\!

Pywikipedia is used to harvest the in-wiki monument lists to the monuments database. I noticed the Error https://bugzilla.wikimedia.org/show\_bug.cgi?id=39973, the following lines are a copy of the existing bug:

Some values provided by headertemplates \(ie 'Gemeinde' in Austrian lists\) are
not filled if there is a template part of any row parameter. Specific example:

http://de.wikipedia.org/wiki/Liste\_der\_denkmalgesch%C3%BCtzten\_Objekte\_in\_Pfons

In article:
\{\{Denkmalliste Österreich Tabellenkopf
|Gemeinde         = Pfons
|Bezirk           = Bezirk Innsbruck Land
<...>
\}\}
\{\{Denkmalliste Österreich Tabellenzeile
|Name              = Friedhof mit Kapellen und Kleindenkmalen
|Beschreibung      = 
|ObjektID          = 110694
<...>
\}\}
\{\{Denkmalliste Österreich Tabellenzeile
|Name              = Kath. Pfarrkirche Mariä Himmelfahrt
|Beschreibung      = \{\{Hauptartikel|Mariä-Himmelfahrt-Kirche \(Pfons\)\}\}
|ObjektID          = 64604
<...>
\}\}

and in database:
SELECT \`objektid\`, \`name\`, \`gemeinde\`, \`bezirk\` FROM 
\`p\_erfgoed\_p\`.\`monuments\_at\_\(de\)\` WHERE \`objektid\` = 110694 or \`objektid\` =
64604;

| objektid | name                       | gemeinde | bezirk
| 110694   | Friedhof mit Kapellen<...> | Pfons    | Bezirk Innsbruck Land
| 64604    | Kath. Pfarrkirche Mar<...> |          | 

many other examples can be found by SELECT \* FROM 
\`p\_erfgoed\_p\`.\`monuments\_at\_\(de\)\` WHERE \`gemeinde\` = '';
Comment 1 Kunal Mehta (Legoktm) 2013-10-05 04:37:04 UTC
could you give me a pwb code snippet or a script command line to reproduce this behaviour
Comment 2 Kunal Mehta (Legoktm) 2013-10-05 04:37:06 UTC
- **assigned_to**: nobody --> xqt
Comment 3 Ricordisamoa 2014-05-25 16:17:43 UTC
mwparserfromhell <https://github.com/earwig/mwparserfromhell> is a much more accurate and advanced wikicode parser. It makes reading nested templates easier.
Comment 4 Amir Ladsgroup 2014-07-24 10:50:50 UTC
you can use page.get(expandtemplates=True)
Comment 5 Ricordisamoa 2014-07-24 12:58:02 UTC
expandtemplates is not the solution. Instead, use mwparserfromhell.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links