Page MenuHomePhabricator

upload javascript crashing
Closed, ResolvedPublic


the javascript on Special:Upload is crashing and not doing its work. Firebug reports the error is on upload.js line 56: optionsTable.children is undefined.

Version: 1.16.x
Severity: critical



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:03 PM
bzimport set Reference to bz22970.
bzimport added a subscriber: Unknown Object (MLST).

On which wiki is this happening?

my development wiki here on my localhost, running trunk r64236

I checked with a friend who's also running a recent copy of the trunk code, and he confirms that the javascript crashes out with 'optionsTable.children is undefined' and doesn't do the interactive stuff.

He sees the error in upload.js?268 and I have it in upload.js?269 if that's helpful.

I think perhaps the line:

optionsTable.insertBefore( row, optionsTable.children[1] );

should perhaps be:

optionsTable.insertBefore( row, optionsTable.rows[1] );

This is just looking at the TableSection interface. I did no testing to see if this theory is correct. (but I'll put it on my to do list to see if that solves the issue)

var optionsTable = document.getElementById( 'mw-htmlform-description' ).tBodies[0];

so optionsTable is a TBODY, which is of type HTMLTableSectionElement ( and not of type HTMLCollection. So rows (which is a HTMLCollection) should indeed be used.

Upping the priority of this Firefox Javascript error. Should really be fixed before a release.

Bryan.TongMinh wrote:

My Firefox does have an optionsTable.children. Is this non-standard behaviour?

(In reply to comment #9)

My Firefox does have an optionsTable.children. Is this non-standard behaviour?

Apparently; according to the MDC .children was introduced in FF 3.5. There is no mention of whether or not this is a non-standard extension, though.

optionsTable.childNodes has worked since like the beginning of (DOM) time and does the same, except that it includes TextNodes while .children doesn't.

Bryan.TongMinh wrote:

Fixed in trunk r64948; marked for backporting to 1.16.

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:29 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:22 AM