Last modified: 2010-05-15 15:33:49 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 T5375, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3375 - Internal article fetching not possible when viewing old versions
Internal article fetching not possible when viewing old versions
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
History/Diffs (Other open bugs)
1.4.x
PC Windows XP
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


Attachments

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 
Article::getContentWithoutUsingSoManyDamnGlobals().
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.


Navigation
Links