Page MenuHomePhabricator

Cross-wiki media upload tool throws JavaScript error
Closed, ResolvedPublic

Description

How to reproduce:

  1. Log into Wikipedia
  2. Go to https://en.wikipedia.org/w/index.php?title=Value_theory&action=edit&safemode=1
  3. Click the "Embedded file" button in the editing toolbar (the sunset button)
  4. Click the "Upload" button in the dialog

Expected results: It should let you upload an image.

Actual results: It throws a JavaScript error and does nothing. The error is:
Windows must have a 'name' static property defined.

Browser: Firefox 53 on MacOS

Event Timeline

matmarex subscribed.

This only affects the tool usage in WikiEditor, not in VisualEditor.

Change 353341 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] mw.Upload.Dialog: Define .static.name

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

This is broken since OOjs UI v0.19.0, released on 2017-01-31, and deployed with 1.29.0-wmf.11 on 2017-02-07/09. (But again, it's only broken when the upload dialog is launched from WikiEditor, not from VisualEditor.)

Trying to estimate how many people/uploads could be affected, I ran a query to count the number of cross-wiki uploads per week.

select left(log_timestamp, 8) as week_of, count(*) as num_uploads
from commonswiki.logging
left join commonswiki.change_tag on log_id=ct_log_id
where log_type='upload' and log_action='upload' and ct_tag='cross-wiki-upload'
and log_timestamp > '201610'
group by yearweek(date(log_timestamp))

image.png (817×1 px, 37 KB)

So eyeballing that chart, it looks like this caused a drop from ~3000 to ~2200 cross-wiki uploads per week, over the 12 weeks this has been broken for so far. (Unless something changed at the same time to make the filters preventing uploads stricter, but the drop lines up too nicely with the deployment date for this to be a probable reason.)

Change 353341 merged by jenkins-bot:
[mediawiki/core@master] mw.Upload.Dialog: Define .static.name

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

Change 353475 had a related patch set uploaded (by Jforrester; owner: Bartosz Dziewoński):
[mediawiki/core@wmf/1.30.0-wmf.1] mw.Upload.Dialog: Define .static.name

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

Change 353475 merged by jenkins-bot:
[mediawiki/core@wmf/1.30.0-wmf.1] mw.Upload.Dialog: Define .static.name

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

So eyeballing that chart, it looks like this caused a drop from ~3000 to ~2200 cross-wiki uploads per week, over the 12 weeks this has been broken for so far.

Thanks, interesting data.

BTW. I had a similarly breakage due to static.name in my printdialog gadget, which I only discovered during the hackathon... :(

Change 366262 had a related patch set uploaded (by Jforrester; owner: Bartosz Dziewoński):
[mediawiki/core@REL1_29] mw.Upload.Dialog: Define .static.name

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

Change 366262 merged by jenkins-bot:
[mediawiki/core@REL1_29] mw.Upload.Dialog: Define .static.name

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