VisualEditor: [Regression] Unnamed references get their names corrupted
Closed, ResolvedPublic

bzimport set Reference to bz54341.
Catrope created this task.Via LegacySep 19 2013, 6:04 PM
Catrope added a comment.Via ConduitSep 19 2013, 9:14 PM

Isolated test case: https://en.wikipedia.org/wiki/User:Ed_g2s/Sandbox4

Diagnosis:

The automatically generated names are based on the number of distinct references in the page up to that point, indexed at zero. The first unnamed <ref> tag is the 4th distinct reference on the page (it's preceded by two :1s, a :3 and a :0), so its autogenerated name is :3. However, there so happens to already be a literal <ref name=":3"> on the page, so we get a naming collision and the whole thing goes to hell.

In practice, this situation can only arise after multiple iterations of duplicating unnamed references with VE (which adds <ref name=":n"> tags to the source), then removing or reordering references so the ref tags are aligned exactly right for this bug to occur.

gerritbot added a comment.Via ConduitSep 19 2013, 11:53 PM

Change 85144 had a related patch set uploaded by Catrope:
Failing test for <ref name=":3"> bug

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

gerritbot added a comment.Via ConduitSep 20 2013, 12:27 PM

Change 85144 merged by jenkins-bot:
Prevent naming collisions when generating unique reference names

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

gerritbot added a comment.Via ConduitSep 23 2013, 11:03 PM

Change 85780 had a related patch set uploaded by Catrope:
Prevent naming collisions when generating unique reference names

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

gerritbot added a comment.Via ConduitSep 23 2013, 11:03 PM

Change 85781 had a related patch set uploaded by Catrope:
Prevent naming collisions when generating unique reference names

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

gerritbot added a comment.Via ConduitSep 23 2013, 11:04 PM

Change 85780 merged by jenkins-bot:
Prevent naming collisions when generating unique reference names

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

gerritbot added a comment.Via ConduitSep 23 2013, 11:06 PM

Change 85781 merged by jenkins-bot:
Prevent naming collisions when generating unique reference names

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

Jdforrester-WMF added a comment.Via ConduitSep 26 2013, 6:29 PM
  • Bug 54654 has been marked as a duplicate of this bug. ***
Elitre added a comment.Via ConduitSep 30 2013, 12:03 PM

James,
I think it can be confusing that the name and the number of a reference do not match, although the links work.
See https://en.wikipedia.org/w/index.php?title=User%3AElitre_%28WMF%29%2FSandbox&diff=575128343&oldid=575128003 (the reference #2 gets a ref name:3).

Jdforrester-WMF added a comment.Via ConduitOct 3 2013, 9:48 PM
  • Bug 54445 has been marked as a duplicate of this bug. ***

Add Comment