Revert "Remove mismatched COMMIT from FileDeleteForm"
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 6 Oct 2015 19:06:26 +0000 (19:06 +0000)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 6 Oct 2015 19:06:26 +0000 (19:06 +0000)
The doDeleteArticleReal() call does BEGIN but not COMMIT
and the LocalFile::delete() does no trx commands because
trxLevel() > 0, so the COMMIT here is needed as things are.

This reverts commit 985a8f721459ebea1dc5a0daa178295eec8cf444.

Change-Id: I72529965ae9fe41641f22af12a40ec13ff65a2c1

includes/FileDeleteForm.php

index ae186bc..bcd6db2 100644 (file)
@@ -195,7 +195,9 @@ class FileDeleteForm {
                                // or revision is missing, so check for isOK() rather than isGood()
                                if ( $deleteStatus->isOK() ) {
                                        $status = $file->delete( $reason, $suppress, $user );
-                                       if ( !$status->isOK() ) {
+                                       if ( $status->isOK() ) {
+                                               $dbw->commit( __METHOD__ );
+                                       } else {
                                                $dbw->rollback( __METHOD__ );
                                        }
                                }