Consolidate common Preprocessor caching code
[lhc/web/wiklou.git] / includes / FileDeleteForm.php
index ae186bc..5e7f5b2 100644 (file)
@@ -180,6 +180,8 @@ class FileDeleteForm {
                                $logEntry->setComment( $logComment );
                                $logid = $logEntry->insert();
                                $logEntry->publish( $logid );
+
+                               $status->value = $logid;
                        }
                } else {
                        $status = Status::newFatal( 'cannotdelete',
@@ -195,7 +197,10 @@ 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__ );
+                                               $status->value = $deleteStatus->value; // log id
+                                       } else {
                                                $dbw->rollback( __METHOD__ );
                                        }
                                }