Run LinksDeletionUpdate after commit() in namespaceDupes.php
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 22 Aug 2016 23:15:24 +0000 (16:15 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 22 Aug 2016 23:15:29 +0000 (16:15 -0700)
This DataUpdate (or any for that matter) is not meant to be run in
the same transaction as random other stuff.

Bug: T143631
Change-Id: Ic40865805c26acc88e613a592b922ffb121962d2

maintenance/namespaceDupes.php

index 8fd25a6..d6a9ba8 100644 (file)
@@ -596,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.
                 *
@@ -605,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__ );
+               $updates = [ new LinksDeletionUpdate( $wikiPage ) ];
+               DataUpdate::runUpdates( $updates );
 
                return true;
        }