Removed deprecated Title::moveNoAuth function
[lhc/web/wiklou.git] / maintenance / namespaceDupes.php
index 55f361c..b705500 100644 (file)
@@ -24,6 +24,8 @@
  * @ingroup Maintenance
  */
 
+use MediaWiki\Linker\LinkTarget;
+
 require_once __DIR__ . '/Maintenance.php';
 
 /**
@@ -35,7 +37,7 @@ require_once __DIR__ . '/Maintenance.php';
 class NamespaceConflictChecker extends Maintenance {
 
        /**
-        * @var DatabaseBase
+        * @var Database
         */
        protected $db;
 
@@ -594,6 +596,8 @@ class NamespaceConflictChecker extends Maintenance {
 
                $this->db->delete( 'page', [ 'page_id' => $id ], __METHOD__ );
 
+               $this->commitTransaction( $this->db, __METHOD__ );
+
                /* Call LinksDeletionUpdate to delete outgoing links from the old title,
                 * and update category counts.
                 *
@@ -603,9 +607,8 @@ class NamespaceConflictChecker extends Maintenance {
                 * accidentally introduce an assumption of title validity to the code we
                 * are calling.
                 */
-               $update = new LinksDeletionUpdate( $wikiPage );
-               $update->doUpdate();
-               $this->commitTransaction( $this->db, __METHOD__ );
+               DeferredUpdates::addUpdate( new LinksDeletionUpdate( $wikiPage ) );
+               DeferredUpdates::doUpdates();
 
                return true;
        }