Page MenuHomePhabricator

API modules must make sure getContext()->getTitle() returns a Title object.
Closed, ResolvedPublic

Description

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.


Version: unspecified
Severity: major
Whiteboard: u=dev c=backend p=0

Details

Reference
bz44117

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:25 AM
bzimport set Reference to bz44117.
bzimport added a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).

I guess this can be closed?