Attempting to send the request with an active upload widget was
producing a JavaScript error "TypeError: this.setIcon is not a
function". This was probably broken by Iaaa226ea.
Further, validation was not working correctly since getValue() was
returning undefined rather than null as documented. This was probably
broken by I8d736fbb.
Bug: T229123
Change-Id: I78a6f9f0cffcd229ec0ab80c2309a0ee2089c927
// Can't, sorry.
},
apiCheckValid: function () {
- var ok = this.getValue() !== null || suppressErrors;
- this.setIcon( ok ? null : 'alert' );
+ var ok = this.getValue() !== null && this.getValue() !== undefined || suppressErrors;
+ this.info.setIcon( ok ? null : 'alert' );
this.setTitle( ok ? '' : mw.message( 'apisandbox-alert-field' ).plain() );
return $.Deferred().resolve( ok ).promise();
}