Set context earlier in UploadForm::__construct
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 9 Apr 2015 07:21:33 +0000 (09:21 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Thu, 9 Apr 2015 07:21:33 +0000 (09:21 +0200)
The parent constructor sets the $context for the form, but
getSourceSection is using getUser before the call, which results in a
warning for using RequestContext::getMain().
Just set the context before use.

Change-Id: I88af41b22cf05ce18d3d2852325bc97cd2544556

includes/specials/SpecialUpload.php

index 6f9254b..8390feb 100644 (file)
@@ -787,6 +787,7 @@ class UploadForm extends HTMLForm {
        protected $mMaxUploadSize = array();
 
        public function __construct( array $options = array(), IContextSource $context = null ) {
+               $this->setContext( $context );
                $this->mWatch = !empty( $options['watch'] );
                $this->mForReUpload = !empty( $options['forreupload'] );
                $this->mSessionKey = isset( $options['sessionkey'] ) ? $options['sessionkey'] : '';