From: Aaron Schulz Date: Tue, 6 Oct 2015 19:06:26 +0000 (+0000) Subject: Revert "Remove mismatched COMMIT from FileDeleteForm" X-Git-Tag: 1.31.0-rc.0~9530^2 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=193145f813dd4ac7406fae5e4ba887a698211178;p=lhc%2Fweb%2Fwiklou.git 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 --- 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__ ); } }