X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiSetNotificationTimestamp.php;h=fa6fabf6f6eeb34b23d03709476e5210048f4a92;hb=4e90d55fdc9d31d93e24cf05687eb7d180806f44;hp=dec64cc746c81277b2db875fd9d12a9d4cbd5a19;hpb=d3efb28185e84383ee21f77871f592fbe72f4846;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiSetNotificationTimestamp.php b/includes/api/ApiSetNotificationTimestamp.php index dec64cc746..fa6fabf6f6 100644 --- a/includes/api/ApiSetNotificationTimestamp.php +++ b/includes/api/ApiSetNotificationTimestamp.php @@ -46,7 +46,8 @@ class ApiSetNotificationTimestamp extends ApiBase { $params = $this->extractRequestParams(); $this->requireMaxOneParameter( $params, 'timestamp', 'torevid', 'newerthanrevid' ); - $this->getResult()->beginContinuation( $params['continue'], array(), array() ); + $continuationManager = new ApiContinuationManager( $this, array(), array() ); + $this->setContinuationManager( $continuationManager ); $pageSet = $this->getPageSet(); if ( $params['entirewatchlist'] && $pageSet->getDataSource() !== null ) { @@ -111,24 +112,22 @@ class ApiSetNotificationTimestamp extends ApiBase { : wfTimestamp( TS_ISO_8601, $timestamp ); } else { // First, log the invalid titles - foreach ( $pageSet->getInvalidTitles() as $title ) { - $r = array(); - $r['title'] = $title; - $r['invalid'] = ''; + foreach ( $pageSet->getInvalidTitlesAndReasons() as $r ) { + $r['invalid'] = true; $result[] = $r; } foreach ( $pageSet->getMissingPageIDs() as $p ) { $page = array(); $page['pageid'] = $p; - $page['missing'] = ''; - $page['notwatched'] = ''; + $page['missing'] = true; + $page['notwatched'] = true; $result[] = $page; } foreach ( $pageSet->getMissingRevisionIDs() as $r ) { $rev = array(); $rev['revid'] = $r; - $rev['missing'] = ''; - $rev['notwatched'] = ''; + $rev['missing'] = true; + $rev['notwatched'] = true; $result[] = $rev; } @@ -162,7 +161,7 @@ class ApiSetNotificationTimestamp extends ApiBase { 'title' => $title->getPrefixedText(), ); if ( !$title->exists() ) { - $r['missing'] = ''; + $r['missing'] = true; } if ( isset( $timestamps[$ns] ) && array_key_exists( $dbkey, $timestamps[$ns] ) ) { $r['notificationtimestamp'] = ''; @@ -170,17 +169,18 @@ class ApiSetNotificationTimestamp extends ApiBase { $r['notificationtimestamp'] = wfTimestamp( TS_ISO_8601, $timestamps[$ns][$dbkey] ); } } else { - $r['notwatched'] = ''; + $r['notwatched'] = true; } $result[] = $r; } } - $apiResult->setIndexedTagName( $result, 'page' ); + ApiResult::setIndexedTagName( $result, 'page' ); } $apiResult->addValue( null, $this->getModuleName(), $result ); - $apiResult->endContinuation(); + $this->setContinuationManager( null ); + $continuationManager->setContinuationIntoResult( $apiResult ); } /**