Page MenuHomePhabricator

WikiText content provided by hook `EditFormPreloadText` gets converted to HTML even if VE is in WikiText mode
Closed, ResolvedPublic

Description

When e.g. inserting the following WikiText using the EditFormPreloadText hook ...

* ABC
* DEF

... and VisualEditor starts in WikiText mode (e.g. because visual mode is disabled for target namespace), VisualEditor shows ...

<ul id="mwAQ"><li id="mwAg"> ABC</li>
<li id="mwAw"> DEF</li></ul>

... in the edit area. This is due to a missing check for paction parameter in ApiVisualEditor.php

There is a patch for REL1_31 available: https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/VisualEditor/+/466665/

If accepted, this should probably be cherry-picked to master and REL1_32.

Event Timeline

Osnard created this task.Oct 12 2018, 8:46 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 12 2018, 8:46 AM

Change 466665 had a related patch set uploaded (by Esanders; owner: Nasty):
[mediawiki/extensions/VisualEditor@REL1_31] Fix parse wikitext fragment in paction wikitext.

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

Esanders updated the task description. (Show Details)Oct 12 2018, 3:33 PM

Change 466949 had a related patch set uploaded (by Bartosz Dziewoński; owner: Nasty):
[mediawiki/extensions/VisualEditor@master] Fix parse wikitext fragment in paction wikitext.

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

There is no REL1_32 branch yet, as far as I can see. I don't think it has been cut yet, so the patch in master should be automatically included in it.

There is no REL1_32 branch yet, as far as I can see. I don't think it has been cut yet, so the patch in master should be automatically included in it.

It'll get cut in five days' time.

Change 466949 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Fix parse wikitext fragment in paction wikitext.

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

Change 466665 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@REL1_31] Fix parse wikitext fragment in paction wikitext.

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

I've looked at extensions using the EditFormPreloadText hook and it turns out this problem can be reproduced on Wikimedia projects as well, so asking for QA review.

The only case I've found is creating an info page for a new Wikimedia project on Incubator, for example: https://incubator.wikimedia.org/w/index.php?title=Wp/qaa&action=edit (please don't actually save that page, I have no idea how Incubator works, they might get upset).

Expected preloaded content is like this (using old wikitext editor here):

(Among Wikimedia-deployed extensions, 'EditFormPreloadText' hook is also used by the ProofreadPage, extension but it appears you can't load the new wikitext editor on pages that would be affected.)

JTannerWMF moved this task from Inbox to High Priority on the Editing QA board.Nov 8 2018, 6:46 PM

@JTannerWMF/@matmarex I need clearer QA steps to understand what to test here.

Steps to reproduce:

  1. Visit https://incubator.wikimedia.org/w/index.php?title=Wp/qaa&action=edit

Previously (incorrect):


Now (correct):

marcella closed this task as Resolved.Nov 19 2018, 7:27 PM
marcella claimed this task.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptNov 19 2018, 7:27 PM