Merge "Proper namespace handling for WikiImporter"
[lhc/web/wiklou.git] / includes / specials / SpecialImport.php
index 701e206..9e9f8c0 100644 (file)
@@ -47,17 +47,20 @@ class SpecialImport extends SpecialPage {
         */
        public function __construct() {
                parent::__construct( 'Import', 'import' );
-               $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' );
        }
 
        /**
         * Execute
         * @param string|null $par
+        * @throws PermissionsError
+        * @throws ReadOnlyError
         */
        function execute( $par ) {
                $this->setHeaders();
                $this->outputHeader();
 
+               $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' );
+
                $this->getOutput()->addModules( 'mediawiki.special.import' );
 
                $user = $this->getUser();
@@ -580,7 +583,7 @@ class ImportReporter extends ContextSource {
                                $page = WikiPage::factory( $title );
                                # Update page record
                                $page->updateRevisionOn( $dbw, $nullRevision );
-                               wfRunHooks(
+                               Hooks::run(
                                        'NewRevisionFromEditComplete',
                                        array( $page, $nullRevision, $latest, $this->getUser() )
                                );