Page MenuHomePhabricator

VisualEditor deletes list-defined references when using reference groups and ISBN/magic-links
Closed, ResolvedPublicBUG REPORT

Description

This appears to be a new variation (this time involving reference groups) of https://phabricator.wikimedia.org/T400013

Steps to replicate the issue:

  1. On a wiki with ISBN magic links enabled (e.g., de.wikipedia.org), create a page with the following minimal wikitext:
ABC.<ref group="G" name="N1"/><ref group="G" name="N2"/>
== Quellen ==
<references group="G">
<ref name="N1">
ABC
</ref>
<ref name="N2">
ISBN 978-3-86927-039-5
</ref>
</references>

This example can be found under https://de.wikipedia.org/w/index.php?title=Benutzer:Kallichore/Test&oldid=259220333
2: Make a minor change with the VisualEditor and save the change.

What happens?:
The VisualEditor incorrectly removes the first reference N1.

Further information :
I noticed the problem because of this edit in de.Wikipedia:
https://de.wikipedia.org/w/index.php?title=G%C3%BCnter_Dietrich_%28Ozeanograf%29&diff=259209716&oldid=248770671

Event Timeline

awight triaged this task as Unbreak Now! priority.
awight subscribed.

Escalating and starting work on this, since it's causing data loss on articles.

There is a side issue which is likely related, I'm not sure if it's new: VE cannot see or edit list-defined refs in a custom group. Given the wikitext in the task description,

image.png (321×1 px, 56 KB)

I can reproduce the bug on dewiki and on the dewiki beta, but not locally. I've enabled the magic links setting for ISBN on my local wiki.

One breadcrumb is that the HTML+RDFa sent from VE to Parsoid differs between the wikis that do and do not show this bug. On the happy wiki, there are <li> elements for the references although they are not rendered by VE. On the unhappy wiki, the <li> elements only contain "missingRef". It seems that the references list content is passed through unchanged on the happy wiki, from Parsoid to VE and back.

Change #1183634 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/Cite@master] Test for list-defined refs in custom group

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

Change #1183635 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/Cite@master] Test documenting VE converter with list-defined custom group ref

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

Seems that there's another bug T400596: VE: List defined refs in named groups are not shown when group is missing that in combination with our freshly emit reflist from https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/1175489 leads to that issue. In the bug mentioned the internalItems will be missing from the Wikitext used here, as a result the reflist we emit is incomplete and LDR vanish....

Change #1183634 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Test for list-defined refs in custom group

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

Change #1183635 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Test documenting VE converter with list-defined custom group ref

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

Change #1184782 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] VE Converter: Extend tests for custom list defined refs

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

Change #1184782 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE Converter: Extend tests for custom list defined refs

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

With this there is another bug T101841 doing very similar things for 10 years now. It should be escalating too since it's causing data loss on articles.

This diff is a very actual occurrence: https://de.wikipedia.org/w/index.php?title=Brombeeren&diff=prev&oldid=259557355

<references responsive> has been automatically changed to <references responsive="">

@doctaxon Yes, this is unfortunately a technical limitation of Parsoid. We optimized this already as good as we could, see T212340. Since then existing values like responsive="yes" are respected and not normalized. The only remaining edge-case is responsive which is not supported and normalized to responsive="". T101841 is the better ticket to discuss this.

WMDE-Fisch removed WMDE-Fisch as the assignee of this task.