Topic on Project:Support desk

How to make UploadWizard fields unrequired?

8
Tribly (talkcontribs)

I installed UploadWizard extension on my wiki and everything seems to be working fine, but I stuck with tinkering with it's configuration. How do I setup in $wgUploadWizardConfig in the LocalSettings.php to make the "Source" and "Author(s)" fields and other required fields unrequired? We upload a lot of memes from the internet to our wiki and the wast majority of those memes have unknown authors or just unoriginal, Those required fields also slow down the upload time of our images.

AhmadF.Cheema (talkcontribs)

In your UploadWizard.config.php, try changing:

// Min author string length
'minAuthorLength' => 1,

// Min source string length
'minSourceLength' => 5,

to

'minAuthorLength' => 0,

and

'minSourceLength' => 0,

Maybe this will work.

Tribly (talkcontribs)

I tried to change those but it didn't had any effect.

AhmadF.Cheema (talkcontribs)

OK, scratch the previous edits, there is no need for them.

  • Open file "mw.UploadWizardDeedThirdParty.js" in directory $IP/extensions/UploadWizard/resources
  • Comment out the following lines:
if ( text === '' ) {
				errors.push( mw.message( 'mwe-upwiz-error-blank' ) );
			} else if ( text.length < minLength ) {
				errors.push( mw.message( 'mwe-upwiz-error-too-short', minLength ) );
			} else if ( text.length > maxLength ) {
				errors.push( mw.message( 'mwe-upwiz-error-too-long', maxLength ) );
			}

and


if ( text === '' ) {
				errors.push( mw.message( 'mwe-upwiz-error-blank' ) );
			} else if ( text.length < minLength ) {
				errors.push( mw.message( 'mwe-upwiz-error-too-short', minLength ) );
			} else if ( text.length > maxLength ) {
				errors.push( mw.message( 'mwe-upwiz-error-too-long', maxLength ) );
			}
  • This should work.
  • Note that I don't know php, so I am unsure whether it will break something else or not, but I think it should be fine.
Tribly (talkcontribs)

Thank you very much! This worked perfectly. But by any chance do you know how can I do the same in the Describe section for the "Description" and "Date created" fields as well?

AhmadF.Cheema (talkcontribs)

Wouldn't it be easier to just use some other extension like: Extension:MsUpload?

If bulk uploading is the only feature you want.

AhmadF.Cheema (talkcontribs)

Anyway,

  • Open file "mw.UploadWizardDetails.js" in directory $IP/extensions/UploadWizard/resources
  • Comment out the following lines:
			this.descriptionsDetailsField.$element,

			this.dateDetailsField.$element,

and,

		this.descriptionsDetailsField = new uw.FieldLayout( this.descriptionsDetails, {
			label: mw.message( 'mwe-upwiz-desc' ).text(),
			help: mw.message( 'mwe-upwiz-tooltip-description' ).text(),
			required: descriptionRequired
		} );
		this.mainFields.push( this.descriptionsDetailsField );

and,

		this.dateDetailsField = new uw.FieldLayout( this.dateDetails, {
			label: mw.message( 'mwe-upwiz-date-created' ).text(),
			help: mw.message( 'mwe-upwiz-tooltip-date' ).text(),
			required: true
		} );
		this.mainFields.push( this.dateDetailsField );
Tribly (talkcontribs)

Thank you very much! :)