Page MenuHomePhabricator

#cite_note and #cite_ref links generated from empty references are broken
Closed, ResolvedPublic

Description

A named reference with no contents produces an inline link, which does not work. The back-link from the footnote to the text does not work either.

Example: https://en.wikipedia.org/wiki/User:Petr_Matas/ref_error

Cause: The identifiers in the footnote entries are missing the number.

Expected<sup id="cite_ref-name_1-0" class="reference"><a href="#cite_note-name-1">
Actualas expectedas expected
Expected<li id="cite_note-name-1"><a href="#cite_ref-name_1-0">
Actual<li id="cite_note-name"><a href="#cite_ref-name_0">

Event Timeline

petr.matas raised the priority of this task from to Needs Triage.
petr.matas updated the task description. (Show Details)
petr.matas added a project: Cite.
petr.matas added a subscriber: petr.matas.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 8 2016, 5:30 PM
petr.matas updated the task description. (Show Details)Feb 8 2016, 5:58 PM
petr.matas set Security to None.
Johsthao closed this task as a duplicate of T126250: <spam>.Feb 8 2016, 6:24 PM
matmarex reopened this task as Open.Feb 8 2016, 6:32 PM

Change 269349 had a related patch set uploaded (by Petr.matas):
Fix T126241: #cite_note and #cite_ref links generated from empty references are broken

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

You should be seeing a big fat red error on that page, though, which is apparently suppressed on en.wp somehow…

petr.matas added a comment.EditedFeb 9 2016, 1:47 AM

@matmarex Yes, if I switch the interface to Czech language, I do see it, but in English I don't.

The patch also fixes the following problem:

Reproduction steps: Use the empty named reference twice
Expected behavior: Two backlinks are generated
Actual behavior: Only one backlink is generated [BUG]

Example: https://en.wikipedia.org/wiki/User:Petr_Matas/ref_error

You should be seeing a big fat red error on that page, though, which is apparently suppressed on en.wp somehow…

https://en.wikipedia.org/wiki/Template:Broken_ref#Namespaces
"Errors on talk and other pages do not show by default but can be enabled by adding a rule to your CSS"

This was introduced in en.wp because there was no automatic <references /> insertion, so whenever people would discuss a fragment with references, you would get bit fat red errors all over the place. It was never really changed after T68860 was fixed I suspect. Maybe something that @Edokter would be interested in.

Change 269349 had a related patch set uploaded (by TheDJ):
#cite_note and #cite_ref links generated from empty references are broken

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

Change 269349 merged by jenkins-bot:
#cite_note and #cite_ref links generated from empty references are broken

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

TheDJ closed this task as Resolved.Feb 12 2016, 9:46 PM
TheDJ assigned this task to petr.matas.
TheDJ triaged this task as Low priority.
TheDJ removed a project: Patch-For-Review.

@petr.matas thanks a lot for this fix !