Remove mismatched COMMIT from FileDeleteForm
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 3 Oct 2015 01:04:45 +0000 (18:04 -0700)
committerKrinkle <krinklemail@gmail.com>
Mon, 5 Oct 2015 19:35:16 +0000 (19:35 +0000)
* Rely on the main DBO_TRX to commit at request end

Change-Id: Iad545db3603335baddc4156128f1dd756dbe99b4

includes/FileDeleteForm.php

index bcd6db2..ae186bc 100644 (file)
@@ -195,9 +195,7 @@ 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() ) {
-                                               $dbw->commit( __METHOD__ );
-                                       } else {
+                                       if ( !$status->isOK() ) {
                                                $dbw->rollback( __METHOD__ );
                                        }
                                }