Page MenuHomePhabricator

Visual Editor - "change reference type" deletes your citation
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • [[Cairns Central]] had some uncited content. I found a newspaper article that was a source, so I copied the URL, opened the article in VE, positioned my cursor at the end of the bullet item "Target discount department store. The store temporarily pulled out of the centre in April 2021 to swap locations with Kmart. The store opened in November 2021."
  • I clicked Cite, choose Automatic, pasted the URL, waited, it failed. OK, Cite> Manual > Website, filled in the URL, the title, the date, the two authors (first and last), the access-date and then saw the "website" box. Damn, I should have used Cite > News. But I had previoulsy noticed the appearance of that Change Reference Type at the bottom of the citation edit box and had thought "now that's a really useful thing, I so often do cite web instead of cite news". So, being in the precise situation, I thought, "Great, I'll use it".

What happens?:

And clicked it and it took me to the menu that you normally get to from "Cite > Manual", and I clicked News. And then found it had deleted every single part of the citation, not a single value was carried over into the corresponding field. I tried to Undo but the citation was completely gone.

What should have happened instead?:

It should have changed the Citation *type* (web to news) and retained the field values for at least those fields in common (authors, title, source date, access date, etc) and, ideally, for the obvious translable ones, (e.g. website -> name of publication). If it doesn't do those things, what is point of it. If I wanted to throw everything away and start from scratch, I would have just done that.

If what I experienced is the intended behaviour, I don't see who is helped by the presence of this button and the button's name is entirely misleading. "Give up and start again" might be a better name for it. Suggesting it is just changing the type of citation is entirely inaccurate.

Given that cite book, cite web, cite news, and cite journal have a huge overlap in their commonly-used parameters, I would have thought it not too hard to have implemented a translation between them with this button. Even if all that happened in terms of the underlying wikitext was to replace "cite web" with "cite news" (which is what I normally do by switching into the wikitext editor), that would be a better result than deleting the lot.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:

Event Timeline

This is the intended behaviour, but it's certainly confusing.

The "Change reference type" button actually replaces the entire contents of the reference. The main use case for it is replacing references that don't use a citation template (or that use a poorly filled out one) with a citation generated by Citoid (the "Automatic" tab) – particularly when the reference is re-used, so you can't just delete the "[1]" and start from scratch, like you suggested. It was added in this task: T208981. You can find in the discussion on that task that we weren't sure how to label the button (it was labelled "Replace reference" or "Recreate" at some points in development).

It seems like a good idea to let it keep the parameters when switching from a citation template to a different manual citation template, though. I also found a past request for this: T87271: Be able to easily change which citation template is being used in a repeated reference.

If we can't do that, maybe we should think about the label again.

Considering the complexity of implementing what this task is currently describing, some intermediate steps we could take:

  1. Button copy: Change the button label so that it informs people that the contents of the references they are attempting to change might be lost
  2. Warning: Explicitly warn people if they are about to take an action that will cause the contents of the references they are attempting to change will be lost

If we were to fulfill the "promise"/expectation the Change reference type is currently setting, we could copy/map some of the parameters between reference types. If/when that mapping cannot be done, explicitly communicate as much.

We should definitely change the label to "replace citation".

I know what people actually wanted was "change citation type" but since that's not what it does, we should fix the label.

Change #1030097 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/Citoid@master] Change button label "Change reference type" to "Replace citation"

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

Change #1030097 merged by jenkins-bot:

[mediawiki/extensions/Citoid@master] Change button label "Change reference type" to "Replace citation"

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

matmarex claimed this task.
matmarex added a project: Citoid.

Tested today, this is not resolved for me. The automatic citation fails, so I tried switching to manual mode (to fill out the template manually), but the url disappears when I chose the template Cite web.

In T300470#9787766, @Patafisik wrote:

Tested today, this is not resolved for me. The automatic citation fails, so I tried switching to manual mode (to fill out the template manually), but the url disappears when I chose the template Cite web.

To be clear, what's resolved was that the button now says "replace citation" which is what it does. It deletes the old one and replace it with an entirely new one.

The ability to change citation type ticket is still open: T87271