Page MenuHomePhabricator

Add support in JsonContent for non-object structures (e.g. array)
Closed, ResolvedPublic8 Estimated Story Points

Description

The News/Journal/Book/Website options under Cite menu is missing now.

IMG_0068.jpg (768×1 px, 37 KB)

Event Timeline

Ryasmeen raised the priority of this task from to Needs Triage.
Ryasmeen updated the task description. (Show Details)
Ryasmeen added a subscriber: Ryasmeen.

Still couldn't reproduce it, but I notice https://test2.wikipedia.org/wiki/MediaWiki:Visualeditor-cite-tool-definition.json is not showing anything - I wonder if that could be related.

@Ryasmeen, if you still get this issue, can you paste the output of mw.msg( 'visualeditor-cite-tool-definition.json' ) while VE is open here?

No, I am not getting it anymore in test2

Ryasmeen set Security to None.

There's definitely something wrong there though - we noticed that trying to change the page I linked to returns "Invalid content data".

Looks like this would be caused by https://gerrit.wikimedia.org/r/#/c/177171/ - CCing Timo and Ori.

Ryasmeen lowered the priority of this task from High to Medium.
Ryasmeen moved this task from To Triage to Freezer on the VisualEditor board.
Jdforrester-WMF renamed this task from Citation options are now missing in test2.m.wikipedia.org to [Regression 1.25wmf14] JSON content blocks that aren't objects (arrays, literals, …) don't display and can't be saved.Jan 15 2015, 4:28 PM
Jdforrester-WMF raised the priority of this task from Medium to High.
Jdforrester-WMF added a project: Regression.

MediaWiki core's JsonContent handler only supports values of which the root structure is an object. This is why message [visualeditor-specialcharinspector-characterlist-insert](https://test2.wikipedia.org/w/index.php?title=MediaWiki:Visualeditor-specialcharinspector-characterlist-insert) works fine, but message visualeditor-cite-tool-definition.json (which is an array) is broken.

While the validation for it having to be an object is new in, it never supported non-objects. This is why these MediaWiki pages didn't get the green/grey/white boxes rendering like Meta-Wiki Schema pages do. The fact that it allowed saving was a bug, and it rendering the page as wikitext instead of JSON visualisation was an undocumented fallback.

The VisualEditor MediaWiki extension is setting the content model for these two messages to JSON in [VisualEditorHooks::onContentHandlerDefaultModelFor](https://github.com/wikimedia/mediawiki-extensions-VisualEditor/blob/1a4c821da/VisualEditor.hooks.php#L47-L59). Until MediaWiki core supports arrays, VE should remove the content model from those pages.

Krinkle renamed this task from [Regression 1.25wmf14] JSON content blocks that aren't objects (arrays, literals, …) don't display and can't be saved to Add support in JsonContent for non-object structures (e.g. array).Jan 16 2015, 1:50 AM
Krinkle lowered the priority of this task from High to Lowest.
Krinkle updated the task description. (Show Details)
Krinkle removed a project: Regression.
Krinkle removed a subscriber: Ryasmeen.
Krinkle raised the priority of this task from Lowest to Medium.
gerritbot added a subscriber: gerritbot.

Change 185385 had a related patch set uploaded (by Krinkle):
JsonContent: Support non-object values as root structure

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

Patch-For-Review

Change 185385 merged by jenkins-bot:
JsonContent: Support non-object values as root structure

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

Change 185584 had a related patch set uploaded (by Krinkle):
JsonContent: Support non-object values as root structure

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

Patch-For-Review

Change 185585 had a related patch set uploaded (by Krinkle):
JsonContent: Support non-object values as root structure

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

Patch-For-Review

Change 185584 merged by jenkins-bot:
JsonContent: Support non-object values as root structure

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

Change 185585 merged by jenkins-bot:
JsonContent: Support non-object values as root structure

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

The citation options are now appearing in test2.