Do not add the license selector when uploading a new version of a file
authorDerk-Jan Hartman <hartman@users.mediawiki.org>
Tue, 4 May 2010 15:07:37 +0000 (15:07 +0000)
committerDerk-Jan Hartman <hartman@users.mediawiki.org>
Tue, 4 May 2010 15:07:37 +0000 (15:07 +0000)
When using "upload a new version", the information in the license field is ignored during submit.
The field has no use in this mode because the information is only added in the filelog, not on
the filepage. As such we should just not add it at all when uploading a new version.

This closes bug 23241.

RELEASE-NOTES
includes/specials/SpecialUpload.php

index 87eb101..c338b65 100644 (file)
@@ -146,6 +146,8 @@ in a negative namespace (which is invalid).
   are now checked when loading Special:Upload. Toolbar link for Special:Upload
   is no longer shown if the user does not have the required permissions.
 * (Bug 23397) texvc in html mode renders \sim as &tilde; not &sim;
+* (Bug 23241) Remove License selector, because it is not used when uploading a
+  new version.
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent
index 6a54294..154f4a6 100644 (file)
@@ -925,17 +925,19 @@ class UploadForm extends HTMLForm {
                        'EditTools' => array(
                                'type' => 'edittools',
                                'section' => 'description',
-                       ),
-                       'License' => array(
+                       )
+               );
+
+               if ( $this->mForReUpload ) {
+                       $descriptor['DestFile']['readonly'] = true;
+               } else {
+                       $descriptor['License'] = array(
                                'type' => 'select',
                                'class' => 'Licenses',
                                'section' => 'description',
                                'id' => 'wpLicense',
                                'label-message' => 'license',
-                       ),
-               );
-               if ( $this->mForReUpload ) {
-                       $descriptor['DestFile']['readonly'] = true;
+                       );
                }
 
                global $wgUseCopyrightUpload;