Page MenuHomePhabricator

Leaving out 'prefix' option breaks Visual Editor when Collection extension is installed
Open, Needs TriagePublic

Description

The prefix option for Parsoid is documented as optional, but when it isn't set the Visual Editor breaks in an esoteric way. When prefix isn't set and you edit an article to have an external link, in some cases it will not save the article and give the message "unknown error". The problem seems to be in the Collection extension, assuming that prefix is set.

This error is generated:
NOTICE: PHP message: PHP Notice: Undefined index: prefix in /.../mediawiki-1.32.0/extensions/Collection/rendering/CollectionRenderingAPI.php on line 250

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 16 2019, 11:18 AM
Conqueredfate renamed this task from Leaving out 'prefix' option breaks visual editor. to Leaving out 'prefix' option breaks Visual Editor when Collection extension is installed.Jan 16 2019, 11:18 AM

Does the VisualEditor issue only happen when Collection is installed? I must say I have no idea how they are even related.

If the PHP notice is the only real problem, then that code can probably be wrapped in an isset(), but that seems too easy to be true.

I must say I have no idea how they are even related.

At one point, the Collection extension used OfflineContentGenerator for PDF rendering, which relied on Parsoid output.

The extension seems to have a fallback to use VE's Parsoid config when available,
https://github.com/wikimedia/mediawiki-extensions-Collection/blob/master/rendering/CollectionRenderingAPI.php#L258-L276

T150872 might know what the current status of PDF rendering is though, since OCG has long been decommissioned for WMF.

JTannerWMF moved this task from To Triage to Freezer on the VisualEditor board.Apr 23 2019, 3:16 PM