Page MenuHomePhabricator

Setting $wgUploadWizardConfig['licensing']['defaultType'] to 'ownwork' or 'thirdparty' causes a JS error
Closed, ResolvedPublic

Description

Author: mnewton

Description:
In UploadWizard.config.php options for default licensing types are given as such:

// Possible values: ownwork, thirdparty, choice.

In fact, the page will not work with "ownwork" and gives this error:

TypeError: mw.UploadWizard.config.licensing.ownWork.defaults is undefined

However, it works fine with "ownWork". Presumably the same applies for "thirdParty".


Version: master
Severity: minor

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:11 AM
bzimport set Reference to bz63494.
bzimport added a subscriber: Unknown Object (MLST).
matmarex subscribed.

I'm going to propose (and mentor) this as a task for Google-Code-In-2015.

This comment was removed by Aklapper.

The issue is actually in the mw.UploadWizardDeedOwnWork.js file:

defaultLicense = config.licensing.ownWork.defaults[ 0 ];

In UploadWizard.config.php, there is no "defaults" key for "ownWork".

Change 261170 had a related patch set uploaded (by PranavK):
UploadWizard's "ownwork" and "thirdparty" are case sensitive

https://gerrit.wikimedia.org/r/261170

matmarex renamed this task from Config options ownwork and thirdparty are case sensitive to Setting $wgUploadWizardConfig['licensing']['defaultType'] to 'ownwork' or 'thirdparty' causes a JS error Config options ownwork and thirdparty are case sensitive.Dec 28 2015, 6:32 PM
matmarex closed this task as Resolved.
matmarex assigned this task to Pranavmk98.
matmarex removed a project: Patch-For-Review.
matmarex set Security to None.
matmarex removed a subscriber: wikibugs-l-list.

Thanks @Pranavmk98! Indeed the task description was wrong about what the real problem was. Sorry about the messy GCI task, and great work in resolving it anyway :)

Change 261170 merged by jenkins-bot:
Define required 'defaults' field in licensing config

https://gerrit.wikimedia.org/r/261170

This caused T123840, reverted in https://gerrit.wikimedia.org/r/264578 :(

@Tgr pointed out in code review on the original patch how it's really
silly that this field is an array when only the first value is used.
Turns out that CampaignSchema actually specifies it as a string,
and will prevent Campaign pages from being saved when it's an array...

On the bright side, that means it was actually impossible to use in
campaigns (when defined as an array, validation would fail and not
save the page; when defined as a string, UploadWizard would throw
exceptions), so we'll be able to correct the code to use it as a string
without breaking changes.

matmarex renamed this task from Setting $wgUploadWizardConfig['licensing']['defaultType'] to 'ownwork' or 'thirdparty' causes a JS error Config options ownwork and thirdparty are case sensitive to Setting $wgUploadWizardConfig['licensing']['defaultType'] to 'ownwork' or 'thirdparty' causes a JS error.Jan 17 2016, 11:13 AM

Change 264697 had a related patch set uploaded (by Bartosz Dziewoński):
Define required 'defaults' field in licensing config, correct the code using it

https://gerrit.wikimedia.org/r/264697

matmarex lowered the priority of this task from Medium to Low.Feb 5 2016, 7:33 PM

Change 264697 merged by jenkins-bot:
Define required 'defaults' field in licensing config, correct the code using it

https://gerrit.wikimedia.org/r/264697