From: umherirrender Date: Thu, 9 Apr 2015 07:21:33 +0000 (+0200) Subject: Set context earlier in UploadForm::__construct X-Git-Tag: 1.31.0-rc.0~11740^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=0a160b3a86a6e6381cfdcd53e03e37fefaff4e1e;p=lhc%2Fweb%2Fwiklou.git Set context earlier in UploadForm::__construct 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 --- diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 6f9254bad1..8390feb083 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -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'] : '';