X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFeedWatchlist.php;h=8c0b42df218435fdb9f35120469bb103fbc09050;hb=2d5af67fb693387abcd62fbd173a69680f725136;hp=c21ac12e821c4dc99003294a7117abd138e56b1f;hpb=9c185ca85c3c58f96e866c9347c2b7f031ddb289;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index c21ac12e82..8c0b42df21 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -69,7 +69,7 @@ class ApiFeedWatchlist extends ApiBase { 'meta' => 'siteinfo', 'siprop' => 'general', 'list' => 'watchlist', - 'wlprop' => 'title|user|comment|timestamp|ids', + 'wlprop' => 'title|user|comment|timestamp|ids|loginfo', 'wldir' => 'older', // reverse order - from newest to oldest 'wlend' => $endTime, // stop at this time 'wllimit' => min( 50, $this->getConfig()->get( 'FeedLimit' ) ) @@ -157,12 +157,8 @@ class ApiFeedWatchlist extends ApiBase { $feedItems[] = new FeedItem( $errorTitle, $errorText, '', '', '' ); } } else { - if ( $e instanceof UsageException ) { - $errorCode = $e->getCodeString(); - } else { - // Something is seriously wrong - $errorCode = 'internal_api_error'; - } + // Something is seriously wrong + $errorCode = 'internal_api_error'; $errorTitle = $this->msg( 'api-feed-error-title', $errorCode ); $errorText = $e->getMessage(); $feedItems[] = new FeedItem( $errorTitle, $errorText, '', '', '' ); @@ -197,7 +193,12 @@ class ApiFeedWatchlist extends ApiBase { } } if ( isset( $info['revid'] ) ) { - $titleUrl = $title->getFullURL( [ 'diff' => $info['revid'] ] ); + if ( $info['revid'] === 0 && isset( $info['logid'] ) ) { + $logTitle = Title::makeTitle( NS_SPECIAL, 'Log' ); + $titleUrl = $logTitle->getFullURL( [ 'logid' => $info['logid'] ] ); + } else { + $titleUrl = $title->getFullURL( [ 'diff' => $info['revid'] ] ); + } } else { $titleUrl = $title->getFullURL( $curidParam ); }