Page MenuHomePhabricator

Jade must not set non-json-serializable properties to JSConfigVars
Closed, ResolvedPublic

Description

Jade is setting an instance of Title class to ParserOutput::setJSConfigVars which is then fails to serialize under`$.JsConfigVars.entityTitle` json-path.

I do not understand how it worked before - JS config vars as I understand are serialized to JSON by OutputPage in order to deliver them to JS. This property is widely used in Jade frontend, but JSON-serialization of it would've failed before. Is there some special handling for Title class in the JS config?

Event Timeline

Ok, this is actually relying on Json serialization of public properties of the title class to be delivered to the JS clients. This is a very wrong thing to do, Title instances in JS config data should be replaced with arrays containing properties needed by frontend.

Change 639639 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/extensions/Jade@master] Do not write Title into JS config vars.

https://gerrit.wikimedia.org/r/639639

Change 639639 merged by jenkins-bot:
[mediawiki/extensions/Jade@master] Do not write Title into JS config vars.

https://gerrit.wikimedia.org/r/639639

Pchelolo claimed this task.