Page MenuHomePhabricator

Upload Wizard on Commons does not prefill image description (from the file's meta data, or from URL parameter)
Closed, ResolvedPublic

Description

The Upload Wizard on Commons used to copy the image title field from the meta data field into the description field. It does not do that anymore. This is a major disadvantage.

Event Timeline

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

It seems to be resolved, at the moment.

matmarex added subscribers: Herzi.Pinki, matmarex.

This seems to also affect descriptions prefilled using URL parameters:

This seems to be broken again.

Uploading more than one image with e.g. https://commons.wikimedia.org/wiki/special:uploadWizard?campaign=wlm-at&id=38344&descriptionlang=de&description=Kapelle+hl.+Johannes+der+T%C3%A4ufer&categories=Johanneskapelle%2C+Traunkirchen results in only the first one being shown in the description dialogue and fields are missing (description, date, source file name, etc.).

@janarkesteijn Can you upload an example file here (using the button on the toolbar), or link to a file that caused this problem on Commons? It would make it easier for developers to test this.

matmarex renamed this task from Upload Wizard on Commons does not copy info from the file's meta data to Upload Wizard on Commons does not prefill image description (from the file's meta data, or from URL parameter).Apr 24 2018, 7:06 PM

With @Herzi.Pinki's example, I get an error in browser console:

TypeError: uw.SingleLanguageInputWidget.static.getClosestAllowedLanguage is not a function
    at mw.UploadWizardDetails.buildInterface (https://commons.wikimedia.org/w/extensions/UploadWizard/resources/mw.UploadWizardDetails.js?f6f3b:263:45)
    at mw.UploadWizardDetails.attach (https://commons.wikimedia.org/w/extensions/UploadWizard/resources/mw.UploadWizardDetails.js?f6f3b:303:11)
    at MWUploadWizardUpload.<anonymous> (https://commons.wikimedia.org/w/extensions/UploadWizard/resources/controller/uw.controller.Details.js?bc60c:71:19)
    at Function.each (https://commons.wikimedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:362:19)
    at UWControllerDetails.uw.controller.Details.load (https://commons.wikimedia.org/w/extensions/UploadWizard/resources/controller/uw.controller.Details.js?bc60c:61:5)
    at UWControllerDeed.uw.controller.Step.moveNext (https://commons.wikimedia.org/w/extensions/UploadWizard/resources/controller/uw.controller.Step.js?0b078:156:18)
    at Array.<anonymous> (https://commons.wikimedia.org/w/extensions/UploadWizard/resources/controller/uw.controller.Deed.js?39ad4:84:43)
    at mightThrow (https://commons.wikimedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:3583:29)
    at process (https://commons.wikimedia.org/w/load.php?debug=true&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=1nv7gwr:3651:12)

Looks like this method was renamed in {feee3d4f8} (and changed from static method to prototype method), but not all callers were correctly updated.

Yes, was about to write that the error is reproducable with two random jpeg-files and Herzi Pinki's link (tested with Internet Explorer).

@matmarex no need to upload anything, just call the url and in the consecutive steps in the UW you will see that input fields are not properly filled (you can use any pair of files) and that there is only a description step for one of the many files uploaded in UW call.

I am sorry, I can't reproduce the error anymore.

I am sorry, I can't reproduce the error anymore.

Did you try the link that Herzi Pinki mentioned? That error is still reproducable, tested it a minute ago on Chrome and IE with two random pictures.

https://commons.wikimedia.org/wiki/File:A_lady_in_a_blue_dress,_by_Tilly_Kettle.jpg is an example of the error. The Description field used to be filled with the content of the field Image title from the meta data.

On the 25th none of my uploads with the UploadWizzard copied data from the metadata to the description field.

Try to be more precise than before:

  • I try to upload >1 files with the UW, but only for one of the files I get to the description step (the first, the last? - don't know, no preview shown)

For any file uploaded via the UW:

  • Name is empty (normally this is the local name of the file)
  • Description is empty (not copied from the url parameter)
  • Date is empty (normally this is the capture date of the image)

Other fields like ids seem to work.

Remark: https://de.wikipedia.org/wiki/Wikipedia:Wiki_Loves_Earth_2018/Deutschland starts on 1st of May. The UW is used in that context: https://commons.wikimedia.org/wiki/Commons:Wiki_Loves_Earth_upload_de. It should work properly.

kaldari triaged this task as High priority.Apr 25 2018, 6:07 PM
kaldari subscribed.

Marking as high priority due to data loss.

Change 429121 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/UploadWizard@master] Fix calls to getDefaultLanguage()/getClosestAllowedLanguage()

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

Change 429121 merged by jenkins-bot:
[mediawiki/extensions/UploadWizard@master] Fix calls to getDefaultLanguage()/getClosestAllowedLanguage()

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

Change 429272 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/UploadWizard@wmf/1.32.0-wmf.1] Fix calls to getDefaultLanguage()/getClosestAllowedLanguage()

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

I scheduled the backport for SWAT deployment later today (https://wikitech.wikimedia.org/wiki/Deployments#deploycal-item-20180426T2300), however I will not be available to verify the fix. Someone else will have to show up on #wikimedia-operations on IRC, otherwise it probably will not be deployed.

(If it's not backported, the fix will be deployed to Commons next Wednesday, 2 May, per the usual schedule.)

Change 429272 merged by jenkins-bot:
[mediawiki/extensions/UploadWizard@wmf/1.32.0-wmf.1] Fix calls to getDefaultLanguage()/getClosestAllowedLanguage()

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

matmarex claimed this task.
matmarex removed a project: Patch-For-Review.
matmarex added a subscriber: brooke.

This has been fixed in production (on Commons) yesterday when the patch above was deployed. @brion looked over the deployment, thanks!