SuchABot has uploaded a new change for review. https://gerrit.wikimedia.org/r/72850
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(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/50/72850/1 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: newchange Gerrit-Change-Id: Id2fa3f587ab4f42b20b257748b9f14417c12a08c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: SuchABot <[email protected]> Gerrit-Reviewer: Yuvipanda <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
