jenkins-bot has submitted this change and it was merged.

Change subject: Fix JS error when using uploadwizard without campaigns
......................................................................


Fix JS error when using uploadwizard without campaigns

Stub old 'defaults' behavior in JS to prevent ride down the rabbit hole.

Change-Id: Id2fa3f587ab4f42b20b257748b9f14417c12a08c
GitHub: https://github.com/wikimedia/mediawiki-extensions-UploadWizard/pull/4
---
M resources/mw.UploadWizardLicenseInput.js
1 file changed, 1 insertion(+), 3 deletions(-)

Approvals:
  MarkTraceur: Looks good to me, approved
  Cmcmahon: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/resources/mw.UploadWizardLicenseInput.js 
b/resources/mw.UploadWizardLicenseInput.js
index 35c7468..2f52997 100644
--- a/resources/mw.UploadWizardLicenseInput.js
+++ b/resources/mw.UploadWizardLicenseInput.js
@@ -6,7 +6,6 @@
  * @param {Array|undefined} license key name(s) to activate by default
  * @param {Object} configuration of licenseInput. Must have following 
properties
  *                             'type' = ("and"|"or") -- whether inclusive or 
exclusive license allowed
- *                             'defaults' => array of template string names 
(can be empty array),
  *                             'licenses' => array of template string names 
(matching keys in mw.UploadWizard.config.licenses)
  *                             optional: 'licenseGroups' => groups of 
licenses, with more explanation
  *                             optional: 'special' => String -- indicates, 
don't put licenses here, instead use a special widget
@@ -27,7 +26,6 @@
 
        if (
                config.type === undefined ||
-               config.defaults === undefined ||
                ( config.licenses === undefined && config.licenseGroups === 
undefined )
        ) {
                throw new Error( 'improper initialization' );
@@ -38,7 +36,7 @@
 
        _this.type = config.type === 'or' ? 'radio' : 'checkbox';
 
-       _this.defaults = config.defaults;
+       _this.defaults = ( config.licenses && config.licenses[0] ) ? [ 
config.licenses[0] ] : [];
 
        mw.UploadWizardLicenseInput.prototype.count++;
        _this.name = 'license' + mw.UploadWizardLicenseInput.prototype.count;

-- 
To view, visit https://gerrit.wikimedia.org/r/72850
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2fa3f587ab4f42b20b257748b9f14417c12a08c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: SuchABot <[email protected]>
Gerrit-Reviewer: Cmcmahon <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to