Fandom Developers Wiki

NoLicenseWarning shows a warning message when an user attempts to upload a file without selecting a license. By default, they can upload the file anyway by simply resending the form.



You can configure whether the script should prevent users from uploading files without licenses or just let them know that selecting a license is strongly recommended (default) and which user groups won't be affected by this script. It's also possible to change the default warning and rejection messages.

Script settings

Script configuration is stored in the window.NoLicenseWarning object and following variables are available:

Variable Description Data type Default value
forceLicense Whether a license should be forced or not. Boolean false
excludedGroups List of user groups that aren't affected by script. You can check user groups available on your wiki by visiting Special:ListGroupRights. Array ['bureaucrat', 'sysop', 'content-moderator', 'bot']

Code below contains example configuration that you can use by adding to the MediaWiki:Common.js page on your wiki:

// Configuration for NoLicenseWarning
window.NoLicenseWarning = {
    forceLicense: true,
    excludedGroups: [

Custom messages

If you want to use different banner messages, add following code to the MediaWiki:Common.js page on your wiki:

// Prepare custom messages for NoLicenseWarning = || {}; = || {}; = || {};['NoLicenseWarning'] =['NoLicenseWarning'] || {};

// Add custom content instead of default messages['NoLicenseWarning']['warning-text'] = 'Your custom warning message';['NoLicenseWarning']['rejected-text'] = 'Your custom rejected message';

Other notes

  • Users within global groups such as staff, wiki-specialist, etc. are never affected by this script. Local user groups exceptions can be configured in the excludedGroups array.
  • It's possible for users to bypass this script by disabling JavaScript in their web browser or by using the ?usesitejs=0 URL parameter (?safemode=1 on UCP wikis). There's no technical solution available to prevent users from uploading unlicensed files with absolute effectiveness.
Text above can be found here (edit)