Commons:Upload Wizard feedback/Archive/2016/08

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Archive This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page.

Can't stop upload at "Describe" screen

I'm uploading a few Locator maps at the same time, and I realize at the "Describe" screen that one already exists (same file format, same style). I just took the time to fill in all the descriptions and categories, and it won't let me cancel the upload just for the single file?

Should I really have to go back and redo everything? It seems like it would be worthwhile to just put a cancel button next to each individual upload for the entire process. Brightgalrs (talk) 10:27, 2 August 2016 (UTC)

@Brightgalrs: Good idea, I filed it as phab:T141907. Please watch the Phabricator task for updates. Matma Rex (talk) 18:57, 2 August 2016 (UTC)
Thanks! Brightgalrs (talk) 23:58, 2 August 2016 (UTC)

Private Wiki Customization

Hi everybody and thank you to the UploadWizard team.

I've just installed it on a private wiki for my neighborhood, or around 65 families. I've been customizing the installation for our needs but I'm struggling to understand how to remove the unnecessary licensing options and provide some straightforward ones for internal use. Ease of use is of particular importance as we have users of all ages and computer-literacy level. Ultimately we only need two options:

  • This file can be used in whichever way you like.
  • This file can only be used within the context of our community.

Even better it would be to remove all licensing options and just leave the existing fields for Source/Author. Would this be possible?

Also, as I've disabled the Tutorial page, but how do I remove the "Learn" tab in the headbar?

Kind regards, Manu3d (talk) 15:47, 6 August 2016 (UTC)

The first option is called {{CC-0}}, the second is not a license. If you don't need a wizard through copyright things, what do you need UploadWizard for? Maybe editing MediaWiki:Licenses and using Special:Upload would be enough. You can probably configure most stuff by redefining $wgUploadWizardConfig['licenses'], but UploadWizard has a limited flexibility as regards copyright tags (see phabricator:T31955). --Nemo 23:41, 6 August 2016 (UTC)
If you don't need a wizard through copyright things, what do you need UploadWizard for? – Maybe for uploading multiple files? LX (talk, contribs) 19:53, 7 August 2016 (UTC)
I confirm LX got it right: one of my user explicitly requested the facility to upload multiple files at once. Give that our is a private wiki licensing makes sense only as a hint for how a file should be used, but is not a requirement. -- Manu3d (talk) 14:52, 11 August 2016 (UTC)
@Manu3d: Yeah, this can be configured with $wgUploadWizardConfig['licenses'] (this is actually the most configurable part of UploadWizard, but it's underdocumented). There is a simple example to leave just one licensing option in the README. For what you described, I think the following should work:
$wgUploadWizardConfig['licensing'] = [
	'ownWorkDefault' => 'choice',
	'ownWork' => [
		'type' => 'or',
		'template' => 'self',
		'licenses' => [
	'thirdParty' => [
		'type' => 'or',
		'defaults' => 'generic',
		'licenseGroups' => [
				'head' => 'mwe-upwiz-license-generic-head',
				'licenses' => [ 'generic' ]
				'head' => 'mwe-upwiz-license-custom-head',
				'special' => 'custom',
				'licenses' => [ 'custom' ],
This leaves three licensing options – own work released under the CC0 license (this essentially allows anyone to use the file for anything without providing attribution – like public domain), a "generic" option which just says "this complies with this wiki's policies" (you can customize the text on the page MediaWiki:mwe-upwiz-license-generic on your wiki), and a "custom" option which is just a text field accepting any input. Matma Rex (talk) 15:58, 7 August 2016 (UTC)
Thank you @Matma Rex:! That should do the trick! Much appreciated. -- Manu3d (talk) 14:52, 11 August 2016 (UTC)
@Matma Rex: Spoke too soon. I added the snippet above to LocalSettings.php. It is syntactically correct as it doesn't generate an outright error, the UploadWizard page loads up. But the "Release rights" step displays just the grey frame where the image would be and nothings else. No licensing choices/dropdown menus. Perhaps interestingly, if I remove the whole "thirdParty" section, it works, but it seems to use the value of the default licensing array variable. How can I debug this? I'm not getting any error_log in the extension nor the wiki installation directory. -- Manu3d (talk) 12:17, 12 August 2016 (UTC)
@Manu3d: Sorry for late response. No idea why it would do that :( I tested that snippet with the latest version of UploadWizard (master) and it worked fine for me. Perhaps there's some bug in the version you're using that we fixed fairly recently. Matma Rex (talk) 18:06, 16 August 2016 (UTC)
Actually, this might be the same issue that has fixed. The config above should work fine with UploadWizard for MediaWiki 1.27 or master. Matma Rex (talk) 18:09, 16 August 2016 (UTC)

Hi everybody, and especially @Matma Rex:, I'm resetting the indentation as I'll be writing a fair bit about what I tried, some time after the last message was posted.
Sadly I cannot install MW 1.27 at this stage and it appears that the latest version of UW doesn't work/solve the problem for the MW 1.26 installation I run. I even tried to manually go through the diff of the gerrit commit you pointed me to Matma, looking into the php source and manually patching the code to replicate the changes. Unfortunately the version of UW I'm using is missing at least one file compared to the version on gerrit and I gave up with the manual patch idea.

However, I didn't give up completely. As I perceived that some changes I was making to the content of $wgUploadWizardConfig['licensing'] were being ignored (might be due to the need to reload the upload page after config changes), I started editing UploadWizard.config.php instead, in attempt to reduce it to a bare minimum and build from that base. The result of this "pruning" in UploadWizard.config.php is this:

 'licensing' => array(
                // Default license type.
                // Possible values: ownwork, thirdparty, choice.
                'defaultType' => 'choice',

                // Should the own work option be shown, and if not, what option should be set?
                // Possible values:  own, notown, choice.
                'ownWorkDefault' => 'choice',

                // radio button selection of some licenses
                'ownWork' => array(
                        'type' => 'or',
                        'template' => 'self',
                        'licenses' => array('ownInternal',),

                // checkbox selection of all licenses
                'thirdParty' => array(
                        'type' => 'or',
                        'licenseGroups' => array(
                                        'licenses' => array( 'internal',),

and this is how those two new licenses are defined:

                'internal' => array(
                                   'msg' => 'mwe-upwiz-license-internal',
                                   'templates' => array('Third Party Internal File License',),
                'ownInternal' => array(
                                       'msg' => 'mwe-upwiz-license-ownInternal',

This is the simplest working setup I could come up with.

The idea behind those "internal" strings being that I can then customize whatever message they require. With this setup (and a few required templates) the generated file page is now good enough. What I need to further customize are the messages such as "mwe-upwiz-license-ownInternal" and "mwe-upwiz-license-internal". Where should those be stored?

Also, in the case of the "own work" how do I change the template in the "Licensing" section of the File page so that it is something other than "Template:Self"?

Finally, in the "thirdParty" section, how do I avoid using the licenseGroups and provide a single licenses array, like it's done in the ownWork section? -- Manu3d (talk) 21:33, 24 August 2016 (UTC)

@Manu3d: Neat. I'm glad you got it to work, and sorry that it requires so much weird configuration.
  • You can add something like this to the page "MediaWiki:Common.js" on your wiki (repeat for every message):
    mw.messages.set('mwe-upwiz-license-internal', "Text for the internal license");
    (Normally in MediaWiki, to add or override localisation messages you create/edit a page like "MediaWiki:Mwe-upwiz-license-ownInternal", but UploadWizard only loads localisation messages from a hardcoded list, so you have to cheat with the mw.messages.set thing :( )
No problem: it works! Question: is there any way to localize those strings? Our wiki is in German by default but we also have English speaking users. -- Manu3d (talk) 21:56, 25 August 2016 (UTC)
if ( mw.config.get('wgUserLanguage') === 'de' ) {
    mw.messages.set('mwe-upwiz-license-internal', "die Katze");
} else if ( mw.config.get('wgUserLanguage') === 'es' ) {
    mw.messages.set('mwe-upwiz-license-internal', "un gato");
} else {
    mw.messages.set('mwe-upwiz-license-internal', "a cat");
Matma Rex (talk) 23:48, 25 August 2016 (UTC)
  • You can change the 'template' => 'self', line to use any other template name.
I thought I tried that. I'll try again. I suspect I suffered from an issue with the browser cache, where I wouldn't see changes just because the browser didn't reload the latest version if the files relevant to UW. -- Manu3d (talk) 21:56, 25 August 2016 (UTC)
  • You should be able to just use licenses, like so:
                    'thirdParty' => array(
                            'type' => 'or',
                            'licenses' => array( 'internal',),
    If that doesn't work, I'm afraid this can't be done. (It should work on the latest version of UW at least, not sure about older ones.)
Matma Rex (talk) 18:13, 25 August 2016 (UTC)
Understood. Thank you @Matma Rex:! -- Manu3d (talk) 21:56, 25 August 2016 (UTC)

file format

Can't you please also add mp3 ,mp4 and also 3gp because these types of format are not available on my mobile phone,PLEASE.

— Preceding unsigned comment added by (talk • contribs)

20:14, 29 August 2016 (UTC)