Last modified: 2011-03-13 18:05:43 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 T24079, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22079 - api returns wrong list of used templates on old revisions
api returns wrong list of used templates on old revisions
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Lowest normal (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-11 10:08 UTC by Ralf Schmitt
Modified: 2011-03-13 18:05 UTC (History)
5 users (show)

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


Attachments

Description Ralf Schmitt 2010-01-11 10:08:23 UTC
The following command
curl 'http://en.wikipedia.org/w/api.php?tllimit=500&format=json&action=query&prop=revisions|templates|images&imlimit=500&rvprop=ids&revids=317439556'

returns:

{
    "query": {
        "pages": {
            "24520081": {
                "ns": 2,
                "pageid": 24520081,
                "revisions": [
                    {
                        "parentid": 317439411,
                        "revid": 317439556
                    }
                ],
                "title": "User:Headbomb/Sandbox9"
            }
        }
    }
}

But http://en.wikipedia.org/w/index.php?oldid=317439556 uses the "cite web" template, which is missing here. It looks like api.php returns the templates used in the current version of an article even if asked for an older version.

(We need this to work for the collection extension. also see http://code.pediapress.com/wiki/ticket/703)
Comment 1 Bryan Tong Minh 2010-01-11 11:03:01 UTC
(In reply to comment #0)
> But http://en.wikipedia.org/w/index.php?oldid=317439556 uses the "cite web"
> template, which is missing here. It looks like api.php returns the templates
> used in the current version of an article even if asked for an older version.
> 
That is true, we don't store old templatelinks data. The only way to get this would be by reparsing the entire content. I'm not sure whether that is the correct solution.
Comment 2 Roan Kattouw 2010-01-11 13:10:07 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > But http://en.wikipedia.org/w/index.php?oldid=317439556 uses the "cite web"
> > template, which is missing here. It looks like api.php returns the templates
> > used in the current version of an article even if asked for an older version.
> > 
> That is true, we don't store old templatelinks data.
Exactly. Moreover, the prop= modules (except for prop=revisions of course) always return data about the latest version of a page rather than the requested revids= . Closing as WONTFIX for this reason.


> The only way to get this
> would be by reparsing the entire content. I'm not sure whether that is the
> correct solution.
> 
Correct or not, it's possible: you can feed a revid to action=parse and you'll get all kinds of data about the parse result, including template and image links. This'll have to do unless and until we start storing historic information in the link tables, which I'm pretty sure will never happen. Also note that parsing the old version of a page will not use any old versions of the templates used in it, so it may produce the 'wrong' result if you're looking for time machine-like functionality.
Comment 3 Ralf Schmitt 2010-01-11 13:34:11 UTC
Thanks for the clarification, that's what I expected. 
It probably will not matter that much in our use case.

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


Navigation
Links