Page MenuHomePhabricator

References defined inside a reflist are incorrectly described as "used twice on this page"
Closed, ResolvedPublicBUG REPORT

Description

Given a page like this:

asdf<ref name=a />

<references><ref name=a>asdf</ref></references>

The context menu incorrectly describes the reference as "used twice on this page":

image.png (441×1 px, 34 KB)

(if the reference is actually used twice, it will say "3 times", etc. – the number is one larger than reality)

This is especially confusing when you are in VE and want to remove only one of the supposedly two used references. If the second reference is in a ref list both will be deleted. If there are actually two references (outside of a reflist) only one gets deleted (which is correct).

  • Do not count usages of references in a ref list.
  • Make sure to not break the correct numbering if the references are outside of a ref list. When the original ref is not in the <references> tag, the number must not be decremented by 1.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
thiemowmde changed the subtype of this task from "Task" to "Bug Report".

Change 892390 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] [POC] Fix wrong "this reference is used twice" in VE

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

Change 892390 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Fix wrong "this reference is used twice" in VisualEditor

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

Change 912308 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] Hide wrong "this reference is used 0 times" in citation dialog

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

Change 911796 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@wmf/1.41.0-wmf.6] Hide wrong "this reference is used 0 times" in citation dialog

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

Change 911797 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@wmf/1.41.0-wmf.5] Hide wrong "this reference is used 0 times" in citation dialog

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

Change 912308 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Hide wrong "this reference is used 0 times" in citation dialog

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

Change 911797 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/Cite@wmf/1.41.0-wmf.5] Hide wrong "this reference is used 0 times" in citation dialog

Reason:

Most certainly not needed any more in about 40 minutes.

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

Change 911796 merged by jenkins-bot:

[mediawiki/extensions/Cite@wmf/1.41.0-wmf.6] Hide wrong "this reference is used 0 times" in citation dialog

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

Mentioned in SAL (#wikimedia-operations) [2023-04-27T07:37:04Z] <jnuche@deploy1002> Started scap: Backport for [[gerrit:911796|Hide wrong "this reference is used 0 times" in citation dialog (T241885 T335410)]]

Mentioned in SAL (#wikimedia-operations) [2023-04-27T07:38:34Z] <jnuche@deploy1002> thiemowmde and jnuche: Backport for [[gerrit:911796|Hide wrong "this reference is used 0 times" in citation dialog (T241885 T335410)]] synced to the testservers: mwdebug1002.eqiad.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug2002.codfw.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-04-27T07:45:37Z] <jnuche@deploy1002> Finished scap: Backport for [[gerrit:911796|Hide wrong "this reference is used 0 times" in citation dialog (T241885 T335410)]] (duration: 08m 33s)