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

Details

Reference
bz63494

Event Timeline

bzimport raised the priority of this task from to Normal.
bzimport set Reference to bz63494.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Apr 3 2014, 6:45 PM
Jdforrester-WMF moved this task from Untriaged to Backlog on the Multimedia board.Sep 4 2015, 6:36 PM
Restricted Application added subscribers: Steinsplitter, Matanya, Aklapper. · View Herald TranscriptSep 4 2015, 6:36 PM
matmarex added a subscriber: matmarex.

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 closed this task as Resolved.Dec 28 2015, 6:32 PM
matmarex assigned this task to Pranavmk98.
matmarex removed a project: Patch-For-Review.
matmarex set Security to None.
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.
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

matmarex reopened this task as Open.Jan 17 2016, 10:45 AM

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.

I'll try this again.

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 Normal 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

matmarex closed this task as Resolved.Feb 15 2016, 5:27 PM
matmarex removed a project: Patch-For-Review.