From 193145f813dd4ac7406fae5e4ba887a698211178 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 6 Oct 2015 19:06:26 +0000 Subject: [PATCH] Revert "Remove mismatched COMMIT from FileDeleteForm" 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index ae186bc950..bcd6db2026 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -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__ ); } } -- 2.20.1