From: LukBukkit Date: Tue, 11 Dec 2018 22:17:53 +0000 (+0100) Subject: Link log entries to Special:Log on ApiFeedWatchlist X-Git-Tag: 1.34.0-rc.0~3270^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/Special:FilePath/%7B%7B%20url_for%28%27show_roles%27%29%20%7D%7D?a=commitdiff_plain;h=ea53369645cc1eb300e9053473c9811706017de7;p=lhc%2Fweb%2Fwiklou.git Link log entries to Special:Log on ApiFeedWatchlist This prevents RSS readers from breaking, because there aren't entries which contain a link to a zero diff anymore. Bug: T210920 Change-Id: Ia5f57b4ab60873bf5d7b2fcf2a2b4f6f90c135b3 --- diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index 37ec3cfd32..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' ) ) @@ -193,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 ); }