X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=blobdiff_plain;f=includes%2Fapi%2FApiDelete.php;h=0e13d705ff76c6618bd0cc1e7b77da0e30536628;hb=4004d3d868831a614b021a4ec1d315faa51ca56d;hp=a63dee6fc186309b62a2ed0b14d5e03bcc52f01d;hpb=8198ea31fdca69685b284e9ba85c450dee854ca2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index a63dee6fc1..0e13d705ff 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -75,9 +75,10 @@ class ApiDelete extends ApiBase { $status = self::delete( $pageObj, $user, $reason, $params['tags'] ); } - if ( !$status->isGood() ) { + if ( !$status->isOK() ) { $this->dieStatus( $status ); } + $this->addMessagesFromStatus( $status, [ 'warning' ], [ 'delete-scheduled' ] ); // Deprecated parameters if ( $params['watch'] ) { @@ -92,8 +93,14 @@ class ApiDelete extends ApiBase { $r = [ 'title' => $titleObj->getPrefixedText(), 'reason' => $reason, - 'logid' => $status->value ]; + if ( $status->hasMessage( 'delete-scheduled' ) ) { + $r['scheduled'] = true; + } + if ( $status->value !== null ) { + // Scheduled deletions don't currently have a log entry available at this point + $r['logid'] = $status->value; + } $this->getResult()->addValue( null, $this->getModuleName(), $r ); } @@ -139,7 +146,7 @@ class ApiDelete extends ApiBase { * @param Page $page Object to work on * @param User $user User doing the action * @param string $oldimage Archive name - * @param string &$reason Reason for the deletion. Autogenerated if null. + * @param string|null &$reason Reason for the deletion. Autogenerated if null. * @param bool $suppress Whether to mark all deleted versions as restricted * @param array $tags Tags to tag the deletion with * @return Status