Page MenuHomePhabricator

Visual Editor adds link= parameter to image when only caption is edited
Open, Needs TriagePublicBUG REPORT

Description

Steps to Reproduce: Here's a link to what happened:
https://en.wikipedia.org/w/index.php?title=COVID-19_pandemic_in_New_York_City&type=revision&diff=966591435&oldid=966591280

The editor used the Visual Editor to change a typo in an image caption. Presumably, a developer could go to that previous version of the article and try to edit the image caption using VE to reproduce this bug.

Actual Results: The Visual Editor added a link= parameter with a modified version of the image file name, and it added an empty alt= parameter.

As a side effect, because the file name was HTML-ized and there appears to be a bug in image syntax processing, the link= parameter and value were displayed as the caption. See T216003 for that bug report.

Expected Results: VE should not add a link= or alt= parameter unless the human editor requests them.

Event Timeline

Jonesey95 created this task.Thu, Jul 9, 2:35 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptThu, Jul 9, 2:35 PM

The bug was first mentioned at https://en.wikipedia.org/wiki//Wikipedia:Village_pump_(technical)#Image_caption_showing_up_as_link?
Tests indicate it happens when the file name has quotation marks. In the example, VisualEditor changed

[[File:NYC Bus with "masks required" sign.jpg|thumb|New York City transit bus. 177th Street near Devoe Ave, Bronx, NY. Route sight reads, "Masks Required"]]

to

[[File:NYC Bus with "masks required" sign.jpg|thumb|New York City transit bus. 177th Street near Devoe Ave, Bronx, NY. Route sign reads, "Masks Required"|link=File:NYC_Bus_with_%22masks_required%22_sign.jpg|alt=]]

The user only changed "sight" to "sign" in the caption.

(This is similar to T193253, which we tried fixing previously, but that patch caused other dirty diffs.)

It should add |alt= parameters, and everyone should (almost) always fill in the blank.

@Jonesey95, how often is the |link= problem turning up?

Jonesey95 added a comment.EditedThu, Jul 9, 10:59 PM

I don't know how often the link= problem is turning up. The devs could probably do some sort of database search to look for VE edits that added link=, which people should almost never be adding.

As for the blank alt= option (it is confusing to refer to it as a parameter, since the image options do not work like template parameters), VE should not add it if the human editor did not ask for it to be added. I don't use VE, so I don't know if the editor is presented with some way to provide a value for the alt= option while modifying the image caption.

Sunpriat2 added a subscriber: Sunpriat2.
Sunpriat2 added a comment.EditedSun, Aug 2, 10:48 AM

The same problem occurs in ruWP. https://ru.wikipedia.org/w/index.php?title=Надписи_из_деревьев&diff=next&oldid=108444834 Our bot periodically cleans it up.
See the fourth picture - https://ru.wikipedia.org/w/index.php?title=Надписи_из_деревьев&oldid=108499780 The link parameter text is added with percent-encoding, which is why the link is visible in the article instead of the file description!