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
This commit is contained in:
Brad Jorsch 2015-10-07 10:19:36 -04:00
parent e36e7e352f
commit 88f6576c08

View file

@ -180,6 +180,8 @@ class FileDeleteForm {
$logEntry->setComment( $logComment ); $logEntry->setComment( $logComment );
$logid = $logEntry->insert(); $logid = $logEntry->insert();
$logEntry->publish( $logid ); $logEntry->publish( $logid );
$status->value = $logid;
} }
} else { } else {
$status = Status::newFatal( 'cannotdelete', $status = Status::newFatal( 'cannotdelete',
@ -197,6 +199,7 @@ class FileDeleteForm {
$status = $file->delete( $reason, $suppress, $user ); $status = $file->delete( $reason, $suppress, $user );
if ( $status->isOK() ) { if ( $status->isOK() ) {
$dbw->commit( __METHOD__ ); $dbw->commit( __METHOD__ );
$status->value = $deleteStatus->value; // log id
} else { } else {
$dbw->rollback( __METHOD__ ); $dbw->rollback( __METHOD__ );
} }