Page MenuHomePhabricator

New (2022) Visual Editor template editor dialog shows existing images as red links
Closed, ResolvedPublic5 Estimated Story Points

Description

To reproduce:

  1. Edit https://en.wikipedia.org/wiki/Palats_Sportu_(Kharkiv_Metro)
  2. Click the infobox at the top.
  3. Go to the "Image" field.
  4. Paste Ezh3 modernized train at Palats Sport station.jpg

Observed: The auto-completion shows the filename in red, even though the file exists on Commons.

Expected: It should be in blue.

Screenshot:

צילום מסך מ־2022-05-24 11-42-28.png (1×935 px, 148 KB)

Event Timeline

thiemowmde subscribed.

Note from today's story time: It looks like this is related to the showImages flag we (half accidentally) enabled in T263535. The most easy fix might be to disable this flag again. Maybe it's possible to fix the issue properly (should be time boxed). So far it looks like the bug is in the OOUI widget that is used there.

From my fist look at this:

It only happens for images that are found on Commons. Local images do not have that problem. I also doubt that it has something to do with the showImages flag. Smoke debugging locally is not possible easily. Will look further into the code though.

So it seems, that this is really just related to the Commons images. The API shows images from Commons as known but missing. The TitleOptionWidgetdoes not differ between missing titles and known titles so it marks every titles that's missing in red. [1]

We could either submit changes upstream to change that behavior and create special handling for known or we 'just' override the styling in our use case. Or do both. The latter as a temporary fix and the former for a proper solution.

[1] https://gerrit.wikimedia.org/g/mediawiki/core/+/89518d5024fab41fa6a153e6539ae0a6597d249d/resources/src/mediawiki.widgets/mw.widgets.TitleOptionWidget.js#80

Change 805087 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/core@master] Don't show title as missing when it's known

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

Change 805087 merged by jenkins-bot:

[mediawiki/core@master] Don't show title as missing when it's known

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

Verified working on beta https://en.wikipedia.beta.wmflabs.org :

  • e.g. add the template Taxobox that has a parameter that expects an image
  • enter Cute and you will see results
  • at least CuteGoat 2.jpg is from beta commons but still rendered blue