Page MenuHomePhabricator

wgCategories should be available when editing or doing another action than viewing the page
Closed, DeclinedPublic

Description

Author: theevilipaddress

Description:
Currently, when you edit a page with categories, wgCategories = []; is empty and you can't use it. However, it would be quite useful to have this when editing, for example on the English Wikipedia for showing the [[Template:BLP editintro]] when an article is within [[Category:Living people]]. Currently, this only works when you view the article and press the "edit" link, but not otherwise.


Version: unspecified
Severity: normal

Details

Reference
bz24254

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:59 PM
bzimport set Reference to bz24254.
bzimport added a subscriber: Unknown Object (MLST).

Reverted in r91974; this looks pretty wrong. Patch makes extra DB calls, assumes things about the 'action' request var, overrides output vars that may have been previously set elsewhere, fails to check for existence before hitting the db, and generally looks really funky.

What exactly is this meant to do, and what side effects are possible? Is this even necessary or useful at all? Fetching random page metadata normally is something we'd expect JS to do via the API...

theevilipaddress wrote:

(In reply to comment #2)

Fetching random page metadata normally is something we'd expect JS to do via the API...

Actually, this is indeed a better idea. Apparently, most folks at Wikimedia just haven't yet done so...