From ea53369645cc1eb300e9053473c9811706017de7 Mon Sep 17 00:00:00 2001 From: LukBukkit Date: Tue, 11 Dec 2018 23:17:53 +0100 Subject: [PATCH] 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 --- includes/api/ApiFeedWatchlist.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 ); } -- 2.20.1