dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiDelete.php
diff --git
a/includes/api/ApiDelete.php
b/includes/api/ApiDelete.php
index
a63dee6
..
0e13d70
100644
(file)
--- 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'] );
}
$status = self::delete( $pageObj, $user, $reason, $params['tags'] );
}
- if ( !$status->is
Good
() ) {
+ if ( !$status->is
OK
() ) {
$this->dieStatus( $status );
}
$this->dieStatus( $status );
}
+ $this->addMessagesFromStatus( $status, [ 'warning' ], [ 'delete-scheduled' ] );
// Deprecated parameters
if ( $params['watch'] ) {
// Deprecated parameters
if ( $params['watch'] ) {
@@
-92,8
+93,14
@@
class ApiDelete extends ApiBase {
$r = [
'title' => $titleObj->getPrefixedText(),
'reason' => $reason,
$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 );
}
$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 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
* @param bool $suppress Whether to mark all deleted versions as restricted
* @param array $tags Tags to tag the deletion with
* @return Status