Last modified: 2010-05-15 15:33:49 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 3375 - Internal article fetching not possible when viewing old versions
Internal article fetching not possible when viewing old versions
Product: MediaWiki
Classification: Unclassified
History/Diffs (Other open bugs)
PC Windows XP
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2005-09-06 19:54 UTC by Travis D
Modified: 2010-05-15 15:33 UTC (History)
0 users

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


Description Travis D 2005-09-06 19:54:04 UTC
We have a customization such that we can categorize articles from a drop down
list, we do something like this:

$t = Title::newFromDBKey("WikiHowCategories");
$a = new Article($t);
$cat_array = split("\n", $a->getContent(true, true));

The problem is is that article::LoadContent references "oldid" parameter in the
request, so even if you specify an article of "title x" getContent will always
return the content of the current old version of the article you're viewing. 

While this works for Wikipedia, if anyone wants to build on top of the software,
it can be a very limiting feature. Possible solutions are adding default
parameters to getContent which ignore the values in wgRequest for oldid and
redirect. It should be possible to load the content of an arbitrary article from
the code when viewing an old version of a particular page.
Comment 1 Brion Vibber 2005-09-06 22:43:29 UTC
As of 1.5 you should use the Revision class for this:

$rev = Revision::newFromTitle( $t );
if( is_null( $rev ) ) {
    // no such page
} else {
    $text = $rev->getText();
    // fetched current revision text...

If you need to run on 1.4 you might try 
Comment 2 Travis D 2005-09-07 15:21:11 UTC
Good to know. Thanks.
Feel free to mark as Invalid then.

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