Page MenuHomePhabricator

Loss of 'alt' texts when manipulating image presentation form
Closed, ResolvedPublic

Description

As an editor using VE within MediaWiki, I would like to be able to change the presentation form of an image (in this case from "thumbnail" to "fullsize") without loosing the "alt" text. I can provide the following example edit from OpenStreetMap wiki: https://wiki.openstreetmap.org/w/index.php?title=Sandbox&type=revision&diff=1791566&oldid=1791564. It looks to me like a data corruption, because the original "alt" data is lost but there would be no need to change it. The HTML contains the filename as alt text for the image.
I would expect:

[[File:Openstreetmap.jpg|alt=This is some OpenStreetMap logo including the label "OpenStreetMap".]]

But I get:

[[File:Openstreetmap.jpg]]

Event Timeline

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

Downstream report at: https://github.com/openstreetmap/operations/issues/172

Personally I never saw/could reproduce this on any Wikipedia/Wikimedia site…

I reproduced this in the MediaWiki wiki today: https://www.mediawiki.org/w/index.php?diff=3141572&oldid=3135703&title=VisualEditor:Test&type=revision&diffmode=source.
Exactly the same issue.
It looks to me as if images of type basic do not store alt texts at all.

Change 499805 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/VisualEditor@master] MWInlineImageNode: don't discard alt text when serializing

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

Change 499805 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] MWInlineImageNode: don't discard alt text when serializing

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