Page MenuHomePhabricator

References broken in debug mode
Closed, ResolvedPublic

Description

ve.dm.MWReferenceNode contains a comparison of element linear data done using a simple object reference equality check (===). In debug mode where objects are frozen with ve.deepFreeze - this check always returns false and breaks toDomElements.

The first attempt to fix this resulted in T296044.

Testing

  1. Open VE in debug mode (?veaction=edit&debug=true)
  2. Create a basic reference with content (e.g. <ref>Foo</ref>)
  3. Inspect the wikitext produced (either by: switch to source mode, showing wikitext changes, or saving)
  4. Observed: The reference is now empty: <ref />
  5. Expected: The reference contents is preserved

Event Timeline

Change 740173 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/Cite@master] ve-cite: Use propert method for comparing linear data (attempt 2)

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

Change 740173 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] ve-cite: Use proper method for comparing linear data (attempt 2)

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

The reference contents is preserved as expected. Check

Screenshot 2021-12-09 at 18.42.30.png (1×2 px, 180 KB)
and
Screenshot 2021-12-09 at 18.50.11.png (824×1 px, 112 KB)

ppelberg claimed this task.