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:
parent
e36e7e352f
commit
88f6576c08
1 changed files with 3 additions and 0 deletions
|
|
@ -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__ );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue