SpecialImport: Don't access $this->getConfig() in the constructor
authorKunal Mehta <legoktm@gmail.com>
Mon, 15 Dec 2014 17:38:11 +0000 (09:38 -0800)
committerUmherirrender <umherirrender_de.wp@web.de>
Fri, 19 Dec 2014 17:27:35 +0000 (17:27 +0000)
The context is only set later on, so call it in the main
execute() function.

Bug: T73376
Change-Id: I34229877df6a8960756565f7df1d680aa8951cba

includes/specials/SpecialImport.php

index da2df2d..c6ebaed 100644 (file)
@@ -47,7 +47,6 @@ class SpecialImport extends SpecialPage {
         */
        public function __construct() {
                parent::__construct( 'Import', 'import' );
-               $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' );
        }
 
        /**
@@ -58,6 +57,8 @@ class SpecialImport extends SpecialPage {
                $this->setHeaders();
                $this->outputHeader();
 
+               $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' );
+
                $this->getOutput()->addModules( 'mediawiki.special.import' );
 
                $user = $this->getUser();