Last modified: 2014-07-01 20:23:54 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 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