Page MenuHomePhabricator

Reference context doesn't show that the reference is reused, which is confusing if you try to delete and recreate it (converting a re-used basic reference to template citation)
Open, NormalPublic

Description

Reference context doesn't show that the reference is reused. It should have something to let users know that it's not a good idea to delete the ref and create a new one in the same place, as that won't update reused references.

There is no convenient way to replace the contents of a basic reference with a template citation generated using Citoid. You have to insert a new reference, then manually replace every use of the old one.


VisualEditor has a problem with name-refs. It does not edit the origin but replaces the ref-link.
In a former post on MediaWiki I thought it's because there was the full reference after the ref-link the in the article I edited. I am not sure if my assumption is correct.

I wrote this on MediaWiki Talk:VisualEditor:
VE does not understand if the ref is linked to another ref later. Example:
Line 1:

<ref name="XYZ" />

20 lines later:

<ref name="XYZ">This is a reference!</ref>

If I edit line one, VE will not edit the origin.
Please see https://de.wikipedia.org/w/index.php?title=EBuLa&diff=182549901&oldid=179684205 (Line 1) for more information.

Details

Related Gerrit Patches:

Event Timeline

Der_Keks created this task.Nov 7 2018, 6:44 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 7 2018, 6:44 PM

It must be more complicated than that? This edit seems to have worked.

It looks like you replaced the citation with a citation template. How did you do that? (What exactly did you click on to make that happen?) I suspect that the visual editor thought you deleted an existing ref, and then created a new/separate/unrelated one.

Uhm that could be the thing, I remember: As this version contained simple text with a [link name] format it could not be converted into the citation template "Internetquelle" (Websource). In result I deleted the old cite note (in believing that it's a "normal" ref) and created a new with the template "Internetquelle".
VE didn't brief me about that :)

There are three options in my opinion:

  • VE tells the user if there is such a constellation of ref-name-tags before deleting (This could disorient other users of the Wikipedia as not everyone is a techie knows how the source-code works)
  • VE support's an option to "convert" a reference without deleting the ref-tags (just a button "convert" which creates a window like that after clicking on "cite" on the same place as the old reference)
  • VE detect's if a reference was deleted and a new created on the new place and asks the user if he want apply this reference to linked refs.

The first option is the easiest, the second option most comfortable I think. If I'd had the second option, that wouldn't have been a problem.

T123778: When Converting a bare URL, just alter the contents, don't replace the reference from @Thryduulf looks similar, except that in one of those links, it appears to keep the named refs connected. A Regression, maybe? Or perhaps the order of the wikitext matters?

Hmm as I understood he changed the ref-name manually but that's not what i did.

The workflow on T123778 is:

  1. In VE, select a bare reference with a name. e.g. <ref name="Smith1970">http://example.com</ref>
  2. click to convert that reference, filling in fields as appropriate
  3. save the changes

The expected outcome is
<ref name="Smith1970">{{template:Cite-web|url=http://example.com}}</ref>
The actual outcome is
<ref name=":0">{{template:Cite-web|url=http://example.com}}</ref>

I think what I describe as the expected outcome here matches your option 2, and your option 3 should/would not be necessary as no changes will be/are made to the reference name.

See also: T52568 and T92432

Oh man! I am searching and searching, now I understand! In language German there is no convert button.
That's what i said before with "could not be converted" -> there was no button so I had to delete and recreate the cite. Classical misunderstanding :)

So there are two problems:

  • With German language set we have no convert button
  • If we had a convert button we probably had the same problem as described in T123778

Maybe we should rename this task here into "Convert button is missing if German locale is set" and work through this and T123778?

Actually, on both en and de Wikipedias there is a convert button if a URL is encased in a <ref> tag but not if it isn't - compare:

On both wikis the reference name was retained after conversion (en, de), but more testing is needed to determine whether this holds true in other circumstances (multiple references, reused, etc) that I don't have time to do right now.

I think it's probably best if this is merged with T123778 (possibly that one into this as this has more discussion?).

Okay but what's with this Version I edited without a convert option (Cite one): https://de.wikipedia.org/w/index.php?title=EBuLa&oldid=179684205&veaction=edit
It's:

<ref name="db-netze-2014-12-04" />

The reference origin follows later.
On your two links I have a convert button but not in my case

Okay but what's with this Version I edited without a convert option (Cite one): https://de.wikipedia.org/w/index.php?title=EBuLa&oldid=179684205&veaction=edit
It's:

<ref name="db-netze-2014-12-04" />

There isn't anything to convert to a template in that reference, so why would it offer to do that?
If you want it to move the definition from later in the articleto the first instance of it being used, that's a different issue and one that is probably worth seeking consensus about first.

Der_Keks added a comment.EditedNov 16 2018, 12:43 PM

Okay, how you would edit that with VE by keeping the ref-names? If I cannot convert anything I need to delete the "old" Basicform reference. In this case the ref-name tag will be deleted too. Because that's what I meant with a "convert-button": A Function which deletes the content of the ref-tag for recreating it with a template by keeping the ref-names.

  • VE support's an option to "convert" a reference without deleting the ref-tags (just a button "convert" which creates a window like that after clicking on "cite" on the same place as the old reference)

You want to convert a reference without a template to one that uses a template. VE can do that, but only where the reference is originally defined, not where it has been reused (as it has been here). See https://en.wikipedia.org/w/index.php?title=User:Thryduulf/sandbox2&oldid=869166099 for a quick illustration.

No that's not the reason why I don't have a convert button:
In your version there is reference one with a template and reference 2 without a template. I can click on both (original and reused) and get a convert button. If I do that with my version (https://de.wikipedia.org/w/index.php?title=EBuLa&oldid=179684205&veaction=edit) I don't have a convert button. That's caused by the cite format:

<ref name[...]>[https://example.com Hello world] Description</ref>

it's not the expected format (like in your version)

<ref name[...]>[https://example.com Hello world]</ref>

That's the reason why I have no convert button. For this case, where VE cannot detect the format, there must be a convert button which (like I already said) creates a window like that after clicking on "cite" at the same place as the old reference (just changing the content)

This problem is not T123778. That task has actually been fixed in 2016 and I just verified that we did not accidentally unfix it since then.

I think the real problem here is this:

It looks like you replaced the citation with a citation template. How did you do that? (What exactly did you click on to make that happen?) I suspect that the visual editor thought you deleted an existing ref, and then created a new/separate/unrelated one.

Uhm that could be the thing, I remember: As this version contained simple text with a [link name] format it could not be converted into the citation template "Internetquelle" (Websource). In result I deleted the old cite note (in believing that it's a "normal" ref) and created a new with the template "Internetquelle".
VE didn't brief me about that :)

So, you actually deleted the existing reused reference and created a new one in the same place. One could say that this was a "user error", but I think there is a problem with the user interface here. It doesn't show that the reference is reused until you try to edit it, so it seems reasonable to just delete it and create a new one, but that actually causes this new reference to be "separated" from the previous reused one.

Correct @matmarex; That's what i tried to say. And I also presented the solution with a "convert" or "re-create" or "replace" (call it how you want) button, which I already mentioned here (second point). It's described a bit misleading, because at that time I didn't know that there was already a "convert" button.

So how do you feel about this suggested solution?

matmarex renamed this task from VE has problems with editing <ref name="XYZ" /> link to Reference context doesn't show that the reference is reused, which is confusing if you try to delete and recreate it.Dec 13 2018, 2:13 AM
matmarex updated the task description. (Show Details)
matmarex moved this task from To Triage to Up next on the VisualEditor board.

@Der_Keks I'm not really sure what your suggestion is. You suggest a "Convert" button, but as we found out there already is one, which doesn't appear for this particular reference, because we can't detect that it is convertible. Can you clarify?

I rephrased the task to describe the part that (I think) we can all agree on :)

I don't know how I could describe it on other ways. Please forget the existing convert-button for following: The first cite in "https://de.wikipedia.org/w/index.php?title=EBuLa&oldid=179684205&veaction=edit" shows a simple-text reference with a link. I want to recreate that reference with the template internet source (Template in the German Wiki). But I also want to keep the ref-name-tags (recitation) in the Article. For that I had the idea for an Button "Recreate", which would be always shown if a reference is reused/recitated (ref name tag).
By clicking on this at the moment not existing "recreate"-button VE will flush the content of the reference (keeping the recitations) and show this "new-reference"-popup (see picture), where I can choose if I want to recreate this cite (by keeping the recitations) with the template internet source, or if i want to use a book-reference, or if i want to enter a manually reference.

I hope you understand what I want.

At the moment I need to add another cite/reference and have to recite manually all places in the article. After that i need to delete the old one.

So if I understand correctly, you would want something like this in the reference context menu:


Clicking the "Recreate" action button would open the same inspector popup as the "Cite" toolbar button (except that the result would replace the existing reference).

Seems like a good idea! I also found another task where the same thing is requested: T179773: [feature request] User scenario to fix old raw references.

I would rather put this button inside the reference dialog itself, though, in place of the "Use an existing reference" button, which is currently mostly useless (it is disabled unless you're inserting a new reference, and the same functionality is reachable more easily from the "Cite" toolbar button). The reasons are:

  • we usually don't put extra actions in the context menus (with the exception of a 'delete' action) – there is very little space for them there, especially on mobile devices
  • I'm not sure if the difference between "Edit" and "Recreate" would be obvious otherwise
  • we did that in the media dialog, and this seems like a similar operation, so it makes sense to be consistent

Mockup of this idea:

If we do this, then the label of the new button could probably be something like "Change reference" (analogous to "Change image" in media dialog), or maybe "Replace reference"?

(Also, this is independent from my idea of adding information that the reference is reused into the context menu. We should probably do both.)

Yeah you understood correctly :) I fully agree with you and your suggestions. I would prefer "Replace reference" because "change reference" sounds like editing the text, which could confuse users.

JTannerWMF moved this task from Up next to Current work on the VisualEditor board.Jan 3 2019, 5:45 PM
JTannerWMF edited projects, added VisualEditor (Current work); removed VisualEditor.

Change 482141 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/Cite@master] Improve warning that reference is reused

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

That only improves the textual warnings, I'm still working on the "Replace reference" functionality. It's a bit more complicated than it looked like, since the code is split between the Cite and Citoid code.

matmarex claimed this task.Jan 3 2019, 8:39 PM

So if I understand correctly, you would want something like this in the reference context menu:

I would avoid complicating this part of the UI for a more advanced feature. I would rather this was buried in the dialog as a "save as copy" type feature.

Change 483335 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/Cite@master] ve.ui.MWReferenceDialog: Remove 'Use an existing reference' button

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

Change 483336 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/Cite@master] ve.ui.MWCitationDialog: If the selected ref is not using the template, clear it

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

Change 483337 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/Citoid@master] Allow any reference to be replaced using Citoid

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

Summary of the series of changes:

  • Improve warning that reference is reused
    • Show the warning in the context menu (on desktop only) in addition to the reference dialog.
    • Add more details to the warning in reference dialog, and adjust spacing around it to make it more noticeable.
  • Remove 'Use an existing reference' button (in the reference dialog – was never present in citation dialog)
  • Allow any reference to be replaced using Citoid
    • Add a "Replace reference" button to reference and citation dialogs from the Cite extension. When clicked, it closes the dialog and opens the Citoid inspector.
    • Citoid inspector has already supported a 'replace' mode, only used when the inspector is opened using the "Convert" button. It was only used for converting "Basic" references to "Automatic" ones. Now the options provided by other tabs in the Citoid inspector are also available. Some notes:
      • "Re-use" tab: Note that this only modifies the individual use of a reference. It doesn't change other places where the reference you're changing is re-used.
      • "Manual" tab:
        • Changing from basic to template, or template to another template, empties the reference and opens the appropriate citation dialog.
        • Changing from template to basic opens the reference dialog with the template inside of it. This is a bit silly, but I'm leaving it in, because this provides a way to set a reference group for a template reference, which was previously impossible (T71498).
  • Use a different dialog title for the Citoid inspector when replacing a reference (this also affects the inspector when opened using the previously existing "Convert" button).

Screenshots of the workflows with the changes (with new/changed parts marked in green circles) – open in new tab for full size:


Change 482141 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] Improve warning that reference is reused

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

matmarex renamed this task from Reference context doesn't show that the reference is reused, which is confusing if you try to delete and recreate it to Reference context doesn't show that the reference is reused, which is confusing if you try to delete and recreate it (converting a re-used basic reference to template citation).Jan 10 2019, 6:05 PM
matmarex updated the task description. (Show Details)

Change 483335 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] ve.ui.MWReferenceDialog: Remove 'Use an existing reference' button

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

Mvolz added a subscriber: Mvolz.Mar 4 2019, 10:04 PM

Change 483336 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] ve.ui.MWCitationDialog: If the selected ref is not using the template, clear it

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

Mvolz removed a project: Citoid.Apr 1 2019, 1:52 PM

The main patch for this change (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Citoid/+/483337) is not merged yet, so none of the UI changes described above have happened.

Marielle proposed an alternative approach on T219801.

Just wanna ask if you could explain me the current status. I currently stuck on this problem while editing :)

Mvolz added a subscriber: ppelberg.May 21 2019, 9:16 AM

Just wanna ask if you could explain me the current status. I currently stuck on this problem while editing :)

So at present the reference shows that it's been re-used with a message to that effect. However we couldn't decide on how to implement replacing the reference from a design standpoint. So it's been kicked up to the product manager @ppelberg :).

At some point it will make it to design and then back to devs but it's going to be a while, sorry :/. I agree it's super annoying, I run into this problem a lot myself. At the moment I just switch to wikitext editing but it's really hard to do it that way and easy to mess up and leave orphaned references about.

Mvolz triaged this task as Normal priority.May 21 2019, 9:16 AM

Okay, thank you! So I'm not alone.

Jess, please have a look at the workflow I proposed: T208981#4868393