Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/239418
Change subject: Unbreak confirmation of no categories being set
......................................................................
Unbreak confirmation of no categories being set
This functionality was broken soon after being introduced by T52352
(7e7066c921c83a0b04b2bc9288314175305f4ce8).
Also, add a way to disable this in UW config, as requested on T51710.
Bug: T51710
Change-Id: I1aa848e7a8ad6e71ba15156b514c64c81956bf0d
---
M UploadWizard.config.php
M resources/mw.UploadWizardDetails.js
2 files changed, 7 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/18/239418/1
diff --git a/UploadWizard.config.php b/UploadWizard.config.php
index 4070be0..069e259 100644
--- a/UploadWizard.config.php
+++ b/UploadWizard.config.php
@@ -637,4 +637,8 @@
// Should we allow multiple files in a form?
'enableMultipleFiles' => true,
+
+ // Should we pester the user with a confirmation step when submitting a
file without assigning it
+ // to any categories?
+ 'enableCategoryCheck' => true,
);
diff --git a/resources/mw.UploadWizardDetails.js
b/resources/mw.UploadWizardDetails.js
index e3cddfa..4240bf5 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -897,14 +897,14 @@
* check if we have all the *must have* but not mandatory
fields filled in
* Currently this tests for the following:
* 1) Empty category
- * 2) TODO
* @return {boolean}
*/
necessaryFilled: function () {
// check for empty category input
- return (
+ return !mw.UploadWizard.config.enableCategoryCheck || (
this.div.find( '.categoryInput' ).val() !== ''
||
- this.div.find( '.cat-list' ).find( 'li'
).length > 0
+ // HACK There's always at least one hidden
category, which this counts. T51710#1653022
+ this.div.find( '.cat-list' ).find( 'li'
).length > 1
);
},
--
To view, visit https://gerrit.wikimedia.org/r/239418
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1aa848e7a8ad6e71ba15156b514c64c81956bf0d
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