Last modified: 2014-03-17 14:47:06 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 T46117, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44117 - API modules must make sure getContext()->getTitle() returns a Title object.
API modules must make sure getContext()->getTitle() returns a Title object.
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Wikidata bugs
u=dev c=backend p=0
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-18 17:25 UTC by Daniel Kinzler
Modified: 2014-03-17 14:47 UTC (History)
3 users (show)

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


Attachments

Description Daniel Kinzler 2013-01-18 17:25:14 UTC
API modules have a getContext() method that returns an ICOntextSource that can be used with EditEntity, etc. That context object has a getTitle() method that will return the context's internal title object or, if that is not set, $wgTitle. Some extensions, like AbuseFilter, rely on this Title object being present, the documentation of IContextSource also requires getTitle() to return a Title object, and never null.

But in the API, $wgTitle may well be null, or, more frequently but just as bad, something nonsensical or inappropriate (e.g. the main page). API modules that modify an entity must ensure that getContext()->getTitle() returns the title object that refers to the entity the module is operating on. This is necessary to allow extensions like AbuseFilter to have the correct context for their task.
Comment 1 Daniel Kinzler 2013-10-29 15:30:35 UTC
*bump*

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


Navigation
Links