From: Brad Jorsch Date: Wed, 7 Oct 2015 14:19:36 +0000 (-0400) Subject: Return log id for file deletions X-Git-Tag: 1.31.0-rc.0~9507^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=88f6576c08815f344c5d5586abe6fa929c49c44e;p=lhc%2Fweb%2Fwiklou.git Return log id for file deletions WikiPage::doDeleteArticleReal returns the log id as the value of the returned Status object, and ApiDelete depends on this. ApiDelete is also expecting FileDeleteForm::doDelete to do the same, so let's make it happen. Bug: T114893 Change-Id: Ia887d88f16378134924d122dad6c17c8a981f0e6 --- diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index bcd6db2026..5e7f5b2635 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -180,6 +180,8 @@ class FileDeleteForm { $logEntry->setComment( $logComment ); $logid = $logEntry->insert(); $logEntry->publish( $logid ); + + $status->value = $logid; } } else { $status = Status::newFatal( 'cannotdelete', @@ -197,6 +199,7 @@ class FileDeleteForm { $status = $file->delete( $reason, $suppress, $user ); if ( $status->isOK() ) { $dbw->commit( __METHOD__ ); + $status->value = $deleteStatus->value; // log id } else { $dbw->rollback( __METHOD__ ); }