(bug 26160) Upload description set by extensions are not propagated
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Tue, 30 Nov 2010 20:57:22 +0000 (20:57 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Tue, 30 Nov 2010 20:57:22 +0000 (20:57 +0000)
Regression originating from the UploadForm rewrite; going to mark for 1.16

CREDITS
RELEASE-NOTES
includes/specials/SpecialUpload.php

diff --git a/CREDITS b/CREDITS
index 07968dd..2842b0c 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -79,6 +79,7 @@ following names for their contribution to the product.
 * Brent G
 * Brianna Laugher
 * Carlin
+* Carsten Nielsen
 * Conrad Irwin
 * Dan Barrett
 * Dan Nessett
index 084cad1..822f521 100644 (file)
@@ -442,6 +442,7 @@ LocalSettings.php. The specific bugs are listed below in the general notes.
 * Show "skin does not exist error" only when the skin is inputted in the wrong
   case.
 * (bug 26164) Potential html injection when the database server isn't available
+* (bug 26160) Upload description set by extensions are not propagated
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.
index e9e127a..7a7a808 100644 (file)
@@ -246,6 +246,7 @@ class SpecialUpload extends SpecialPage {
                        'hideignorewarning' => $hideIgnoreWarning,
                        'destwarningack' => (bool)$this->mDestWarningAck,
 
+                       'description' => $this->mComment,
                        'texttop' => $this->uploadFormTextTop,
                        'textaftersummary' => $this->uploadFormTextAfterSummary,
                        'destfile' => $this->mDesiredDestName,
@@ -740,6 +741,7 @@ class UploadForm extends HTMLForm {
        protected $mDestWarningAck;
        protected $mDestFile;
 
+       protected $mComment;
        protected $mTextTop;
        protected $mTextAfterSummary;
 
@@ -754,6 +756,9 @@ class UploadForm extends HTMLForm {
                $this->mDestWarningAck = !empty( $options['destwarningack'] );
                $this->mDestFile = isset( $options['destfile'] ) ? $options['destfile'] : '';
 
+               $this->mComment = isset( $options['description'] ) ?
+                       $options['description'] : '';
+
                $this->mTextTop = isset( $options['texttop'] )
                        ? $options['texttop'] : '';
 
@@ -930,6 +935,7 @@ class UploadForm extends HTMLForm {
                                'label-message' => $this->mForReUpload
                                        ? 'filereuploadsummary'
                                        : 'fileuploadsummary',
+                               'default' => $this->mComment,
                                'cols' => intval( $wgUser->getOption( 'cols' ) ),
                                'rows' => 8,
                        )