Do deletion updates after commit.
authordaniel <daniel.kinzler@wikimedia.de>
Wed, 10 Sep 2014 17:40:25 +0000 (19:40 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Wed, 10 Sep 2014 17:40:25 +0000 (19:40 +0200)
WikiPage::doDeleteArticleReal now triggers secondary data updates
(link tables, etc) only after the deletion proper is committed.
This is consistent with the way doEditContent applies secondary
data updates, and avoids nested transactions (e.g. by one of the
updates using a retry loop).

Change-Id: Ie4d96f77d210c9953104a0e6fb11ea8ed348c42a

includes/page/WikiPage.php

index b62f40d..9ade16e 100644 (file)
@@ -2876,8 +2876,6 @@ class WikiPage implements Page, IDBAccessObject {
                // Clone the title, so we have the information we need when we log
                $logTitle = clone $this->mTitle;
 
-               $this->doDeleteUpdates( $id, $content );
-
                // Log the deletion, if the page was suppressed, log it at Oversight instead
                $logtype = $suppress ? 'suppress' : 'delete';
 
@@ -2896,6 +2894,8 @@ class WikiPage implements Page, IDBAccessObject {
                        $dbw->commit( __METHOD__ );
                }
 
+               $this->doDeleteUpdates( $id, $content );
+
                wfRunHooks( 'ArticleDeleteComplete', array( &$this, &$user, $reason, $id, $content, $logEntry ) );
                $status->value = $logid;
                return $status;