Page MenuHomePhabricator

data.query is undefined js error
Closed, ResolvedPublic

Description

Author: mdale

Description:
Once you upload your file, release rights, then get to describe. If you put a ] in the categories input box invokes the error "data.query" is undefined

you should ( of course ) check properties before assuming success. ie: instead of line 135 of jquery.mwCoolCats.js
var pages = data.query.allpages;

// you should do something like:
if( data && data.query && data.query.allpages ){

var pages = data.query.allpages;

} else{

// error handling goes here.

}

There are several other places in the code base where you make assignments of decedent properties without checking for their existence, these should be fixed.


Version: unspecified
Severity: minor
URL: http://commons.prototype.wikimedia.org/wiki/Special:UploadWizard?debug=true

Details

Reference
bz28198

Event Timeline

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

neilk wrote:

Assumed fixed with mw.Api.category.js which does the right thing.

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:27 AM
Gilles added a project: Multimedia.
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:23 AM