Last modified: 2014-07-01 20:23:54 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 T14710, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12710 - Classes like Parser and EditPage should use $mTitle member rather than $wgTitle
Classes like Parser and EditPage should use $mTitle member rather than $wgTitle
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.12.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: code_quality $wgTitle
  Show dependency treegraph
 
Reported: 2008-01-20 18:52 UTC by Roan Kattouw
Modified: 2014-07-01 20:23 UTC (History)
3 users (show)

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


Attachments

Description Roan Kattouw 2008-01-20 18:52:15 UTC
$this->mTitle has been introduced to Parser and EditPage quite some time ago, and most of its members use it. Some member functions insist on using $wgTitle, however, which is not only incorrect but breaks the API. I'm personally starting a crusade against $wgTitle in these two classes, but maybe others could start similar crusades against global variables in code segments they know well.
Comment 1 Tim Starling 2008-01-22 10:56:57 UTC
Parser only uses $wgTitle when the relevant entry point does not provide a title in a parameter. 

For robustness, the API should set $wgTitle.
Comment 2 Roan Kattouw 2008-01-22 14:50:45 UTC
(In reply to comment #1)
> Parser only uses $wgTitle when the relevant entry point does not provide a
> title in a parameter.
I found one instance in which it didn't (see r29918), I don't know if there are more.

> For robustness, the API should set $wgTitle.
True, but classes like Parser and EditPage should be usable on pages different from $wgTitle as well, and therefore shouldn't rely on it. 

Comment 3 Roan Kattouw 2008-12-20 20:02:38 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Parser only uses $wgTitle when the relevant entry point does not provide a
> > title in a parameter.
> I found one instance in which it didn't (see r29918), I don't know if there are
> more.
> 
Found another one, see bug 16129 comment #3.

> > For robustness, the API should set $wgTitle.
> True, but classes like Parser and EditPage should be usable on pages different
> from $wgTitle as well, and therefore shouldn't rely on it. 
> 
Bumping this point.

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


Navigation
Links