From 83ead540ae4d9b84a0792022a6a356102ec84490 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Tue, 20 Dec 2016 14:40:03 -0500 Subject: [PATCH] ApiQueryWatchlist: Handle empty wltypes The pre-WatchedItemQueryService code used ApiQueyrBase::addWhereFld() which filters out empty arrays. WatchedItemQueryService doesn't do that. Bug: T153733 Change-Id: I3416b5a05c9751303b5c28a8b6d9cb746a101f73 --- includes/api/ApiQueryWatchlist.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 6b5ceb703f..3f597511a1 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -151,7 +151,10 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { if ( !is_null( $params['type'] ) ) { try { - $options['rcTypes'] = RecentChange::parseToRCType( $params['type'] ); + $rcTypes = RecentChange::parseToRCType( $params['type'] ); + if ( $rcTypes ) { + $options['rcTypes'] = $rcTypes; + } } catch ( Exception $e ) { ApiBase::dieDebug( __METHOD__, $e->getMessage() ); } -- 2.20.1