Page MenuHomePhabricator

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

Description

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

Details

Event Timeline

Ryasmeen created this task.Jan 9 2015, 12:06 AM
Ryasmeen raised the priority of this task from to Needs Triage.
Ryasmeen updated the task description. (Show Details)
Ryasmeen added a subscriber: Ryasmeen.

cannot reproduce

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 closed this task as Resolved.Jan 9 2015, 8:18 PM
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".

Krenair added subscribers: ori, Krinkle.EditedJan 9 2015, 9:03 PM

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

Ryasmeen triaged this task as High priority.Jan 9 2015, 11:05 PM
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.
Krinkle added a comment.EditedJan 16 2015, 1:48 AM

MediaWiki core's JsonContent handler only supports values of which the root structure is an object. This is why message 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. 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 claimed this task.Jan 16 2015, 2:01 AM
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

Jdforrester-WMF closed this task as Resolved.Jan 17 2015, 12:21 AM

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

Krinkle updated the task description. (Show Details)Jan 17 2015, 1:21 AM

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.