Page MenuHomePhabricator

'Contribute an image' button on Special:Uploads not working - Class.extend seems unreliable
Closed, ResolvedPublic

Description

When I go to Special:Uploads and tap 'Contribute an image', I am able to select an image to upload - however after selecting the image to upload, it does not appear to actually get uplaoded and I am not presented with the expected overlay to verify that it's my own work, add additional info, and submit the upload.

This happens in the stable version of the site; tested on Android 4.4 Chrome and desktop Chrome on OS X.


Version: unspecified
Severity: normal

Details

Reference
bz53282

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:45 AM
bzimport set Reference to bz53282.
bzimport added a subscriber: Unknown Object (MLST).

Upload stats graphs (http://mobile-reportcard.wmflabs.org/) suggest that this broke sometime yesterday (Thursday, 22 August)

Er also just realized I wrote 'Android 4.4' - should be 'Android 4.2'

So this explains why several tests have been failing in debug mode. It seems there is something odd about the extend function in that there is a bug in the code somewhere. I've got a fix for this but there is a bigger problem somewhere in our code. Juliusz any ideas?

Change 80665 had a related patch set uploaded by Jdlrobson:
Bug 53282: Don't rely on extend / fix the uploads page button

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

https://gerrit.wikimedia.org/r/80665 < This works and qunit tests pass in debug mode for overlays. It seems this.appendToElement or this.appendTo return null when set via extend.

I suspect this is also what is causing the problem for bug 53123

  • Bug 53123 has been marked as a duplicate of this bug. ***
  • Bug 53124 has been marked as a duplicate of this bug. ***

jgonera wrote:

Nothing seems wrong with Class.extend(). It's just that document.body doesn't seem to be reliable. Try adding console.log(document.body); in the first line of Overlay.js, it returns null for me in Chrome...

well then that code must be loading in the head when document.body doesn't exist?

Change 81012 had a related patch set uploaded by JGonera:
Don't use document.body

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

jgonera wrote:

I revisited bug 52361 and it seems that there's a different fix than using document.body (see previous comment).

jgonera wrote:

Probably, but I'm not sure why. Or maybe document.body on some browsers exists only after the ending tag for body is found (and scripts are still within <body>)?

jgonera wrote:

Also, I am not able to reproduce this bug on master now. Has anything else changed?

Change 81012 merged by jenkins-bot:
Don't use document.body

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

Change 80665 abandoned by Jdlrobson:
Bug 53282: Don't rely on extend / fix the uploads page button

Reason:
abandoned in favour of Ifb45718a29b8d3147be483349b30a4bc080604d6

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