Page MenuHomePhabricator

Images get a link= to raw thumbnail url
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Make a translation of an article with images, from english to greek wikipedia

What happens?:

  • Images are transfered with this wikitext:

[[Αρχείο:Tselina.png|σύνδεσμος=//upload.wikimedia.org/wikipedia/commons/thumb/3/31/Tselina.png/220px-Tselina.png|μικρογραφία| Σελινόριζα που για φαγητό]]
(localised ([[File:Tselina.png|link=//upload.wikimedia.org/wikipedia/commons/thumb/3/31/Tselina.png/220px-Tselina.png|thumb| Σελινόριζα που για φαγητό]]
Revision

What should have happened instead?:
The |link= parameter should not be used.

Happens to all translations.

Software version

The bug was initiated between 26 July (last recorded good translation) - 27 July (first recorded bad translation). MediaWiki 1.39/wmf.22 ?

Event Timeline

It is also happening in catalan wikipedia as well.

Just FYI: this has more than 260 hits in Russian Wikipedia already (which I’ll clean up in the next few days), so this should be a problem that is given more priority given its prevalence.

Will any attention from the language team be given to this task? I don’t want to have to run a bot every week about this, since this is a bug that is present in all of current ContentTranslation output.

This bug affects all wikipedias since July and nothing has been done. Not only it has not been solved: there is no responsible and no roadmap. It seems something is not working in the work flux at Phabricator.

Change 843406 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/services/cxserver@master] Images: Use the resource attribute of image as href for wrapped links

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

Test instructions:
Go to https://cxserver.wikimedia.org/v2?doc#/Machine%20translation/post_v2_translate__from___to_:

Use en, es as language pairs and body as

{
  "html": "<figure class='mw-default-size mw-halign-left' typeof='mw:File/Thumb' id='mwAQs'><a href='./File:Violin.JPG' class='mw-file-description' id='mwAQw'><img resource='./File:Violin.JPG' src='//upload.wikimedia.org/wikipedia/commons/5/52/Violin.JPG' decoding='async' data-file-width='104' data-file-height='293' data-file-type='bitmap' id='mwAQ0' width='104' height='293'></a><figcaption id='mwAQ4'>Violin and bow.</figcaption></figure>"
}

Current result:

{
  "contents": "<figure class=\"mw-default-size mw-halign-left\" data-cx=\"{&#34;adapted&#34;:true}\" id=\"mwAQs\" rel=\"cx:Figure\" typeof=\"mw:File/Thumb\"><a class=\"mw-file-description\" href=\"//upload.wikimedia.org/wikipedia/commons/5/52/Violin.JPG\" id=\"mwAQw\"><img data-cx=\"{&#34;adapted&#34;:true}\" data-file-height=\"293\" data-file-type=\"bitmap\" data-file-width=\"104\" decoding=\"async\" height=\"293\" id=\"mwAQ0\" resource=\"./Archivo:Violin.JPG\" src=\"//upload.wikimedia.org/wikipedia/commons/5/52/Violin.JPG\" width=\"104\"></img></a><figcaption id=\"mwAQ4\">Violin and bow.</figcaption></figure>"
}

Expected result:

{
  "contents": "<figure class=\"mw-default-size mw-halign-left\" data-cx=\"{&#34;adapted&#34;:true}\" id=\"mwAQs\" rel=\"cx:Figure\" typeof=\"mw:File/Thumb\"><a class=\"mw-file-description\" href=\"./Archivo:Violin.JPG\" id=\"mwAQw\"><img data-cx=\"{&#34;adapted&#34;:true}\" data-file-height=\"293\" data-file-type=\"bitmap\" data-file-width=\"104\" decoding=\"async\" height=\"293\" id=\"mwAQ0\" resource=\"./Archivo:Violin.JPG\" src=\"//upload.wikimedia.org/wikipedia/commons/5/52/Violin.JPG\" width=\"104\"></img></a><figcaption id=\"mwAQ4\">Violin and bow.</figcaption></figure>"
}

Note the difference in href attribute of a tag.

Can be tested in CX as follows: Start a translation between any language. Click on a section with image. Publish. The resulting wikitext in published page should not have link= in it.

There is a similar report with examples from Portuguese Wikipedia

Change 843406 merged by jenkins-bot:

[mediawiki/services/cxserver@master] Images: Use the resource attribute of image as href for wrapped links

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

Change 850315 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update cxserver to 2022-10-27-102021-production

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

Change 850315 merged by jenkins-bot:

[operations/deployment-charts@master] Update cxserver to 2022-10-27-102021-production

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

Change 851053 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update cxserver to 2022-10-31-083825-production

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

Change 851053 merged by jenkins-bot:

[operations/deployment-charts@master] Update cxserver to 2022-10-31-083825-production

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

QA PASS

@santhosh I was able to run the Machine translation endpoint call with 200 status code and the response boady below. the href attribute in the a tag returns the expected .JPG file path

{
  "contents": "<figure class=\"mw-default-size mw-halign-left\" data-cx=\"{&#34;adapted&#34;:true}\" id=\"mwAQs\" rel=\"cx:Figure\" typeof=\"mw:File/Thumb\"><a class=\"mw-file-description\" href=\"./Archivo:Violin.JPG\" id=\"mwAQw\"><img data-cx=\"{&#34;adapted&#34;:true}\" data-file-height=\"293\" data-file-type=\"bitmap\" data-file-width=\"104\" decoding=\"async\" height=\"293\" id=\"mwAQ0\" resource=\"./Archivo:Violin.JPG\" src=\"//upload.wikimedia.org/wikipedia/commons/5/52/Violin.JPG\" width=\"104\"></img></a><figcaption id=\"mwAQ4\">Violin and bow.</figcaption></figure>"
}

Able to publish an article, with image, from en to ig

Able to publish an article, with image, from en to ig

Can you share a link to the published article for future reference?

@Pginer-WMF

I did publish an image here : https://ig.m.wikipedia.org/wiki/Nwangele

I attached an image below just in case:

Screen Shot 2022-11-28 at 10.36.34 PM.png (794×401 px, 183 KB)

For the record, someone with global bot permissions also needs to clean up all of the bad code that was added by CX in the meantime (basically, replace everything in https://global-search.toolforge.org/?q="upload.wikimedia.org"&namespaces=0&title= that looks like |skakel=//upload.wikimedia.org/…). If the Language team can find someone to do that themselves, that would be great, since every project was affected by this bug.

FWIW, https://global-search.toolforge.org/?q=%22%3D%2F%2Fupload.wikimedia.org%22&namespaces=0&title= is probably a slightly better search (seems to show only the actual instances of the problem rather than all upload.wikimedia.org links).

I've created a separate task for the clean-up and my explorations so far: T357621: Clean up bad wikitext caused by T314836