Page MenuHomePhabricator

VE doesn't show parent reference on a subreference that is a reuse by name
Closed, InvalidPublicBUG REPORT

Description

Via T247922: Display parent references of subreferences in the VE pop up and wizard we made the parent-child relationship between Cite (Sub-referencing) references visible everywhere in VisualEditor, with one exception: A short <ref name=x/> can actually be a sub-reference. But we only know that after we resolved the name. The current code doesn't do this but assumes an extends=y attribute is there.

Example wikitext to play around with:

A<ref extends=book name=p20>p. 20</ref>
B<ref name=p20 />
C<ref extends=book name=p20 />
<references>
<ref name=book>book</ref>
</references>

The bug here is that the second reference will not show the parent in the ContextItem popup and in the dialog.

Note you can easily run into T367749: Can't reuse an extended reference by name before it is defined when you play around with this example. While the two are related they really are separate issues.

Patch-For-Review:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

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

[mediawiki/extensions/Cite@master] [WIP] Fix parent missing on subrefs without extends attribute

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

This has been mentioned on meta as well. Example:

Screenshot from 2024-08-26 15-46-14.png (536×308 px, 60 KB)

Screenshot from 2024-08-26 15-46-34.png (524×170 px, 13 KB)

Removing the sub-ref tag for "older" issues that we currently don't tackle. This one is also still connected via some epics.

The details approach will not allow reusing a subref by name.

Change #1047510 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/Cite@master] [WIP] Fix parent missing on subrefs without extends attribute

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