Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/249892
Change subject: mw.UploadWizardDetails: We must call every valid() function
......................................................................
mw.UploadWizardDetails: We must call every valid() function
Like the code comment says. Follow-up to
d55b6b166c44cebe25d2fd32cf6f1716fac41f92.
Also remove another, no longer relevant comment.
Change-Id: I6e6e90146a70739298533ab8533472275314d9a9
---
M resources/mw.UploadWizardDetails.js
1 file changed, 12 insertions(+), 11 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/92/249892/1
diff --git a/resources/mw.UploadWizardDetails.js
b/resources/mw.UploadWizardDetails.js
index 0e4c9e4..7cea13a 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -857,25 +857,26 @@
/**
* check entire form for validity
+ * side effect: add error text to the page for fields in an
incorrect state.
*
* @return {boolean} Whether the form is valid.
*/
- // side effect: add error text to the page for fields in an
incorrect state.
- // we must call EVERY valid() function due to side effects; do
not short-circuit.
valid: function () {
- var i;
+ var i, deedValid, formValid;
+
// Kill any active tipsies, they like to get stuck
for ( i = 0; i < this.categoriesWidgetItems.length; i++
) {
this.categoriesWidgetItems[ i ].$element.tipsy(
'hide' );
}
- // all the descriptions -- check min & max length
- // categories are assumed valid
- // pop open the 'more-options' if the date is bad
- // location?
- return (
- this.upload.deedChooser.valid() &&
- this.$form.valid()
- );
+
+ // make sure licenses are valid (needed for multi-file
deed selection)
+ deedValid = this.upload.deedChooser.valid();
+
+ // all other fields validated with validator js
+ formValid = this.$form.valid();
+
+ // we must call EVERY valid() function due to side
effects; do not short-circuit.
+ return deedValid && formValid;
},
/**
--
To view, visit https://gerrit.wikimedia.org/r/249892
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e6e90146a70739298533ab8533472275314d9a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits