From 5e65ae8f645bc83e32c48e5d1bcfa6a88100796b Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Thu, 2 Jun 2016 13:12:16 -0700 Subject: [PATCH] Don't lose namespace when searching via api A recent patch, I66be724d, introduced a regression that no longer applied user selected namespaces to the search engine. Fix that up so we give the correct responses to api rqeuests. Change-Id: I8e5e180cb143ae3cddeb12f51bc7aae75b20fe58 --- includes/api/SearchApi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/SearchApi.php b/includes/api/SearchApi.php index 26d7a0ea94..139793d12b 100644 --- a/includes/api/SearchApi.php +++ b/includes/api/SearchApi.php @@ -86,7 +86,7 @@ trait SearchApi { $type = isset( $params['backend'] ) ? $params['backend'] : null; $searchEngine = MediaWikiServices::getInstance()->getSearchEngineFactory()->create( $type ); $limit = $params['limit']; - $namespaces = $params['namespace']; + $searchEngine->setNamespaces( $params['namespace'] ); $offset = null; if ( isset( $params['offset'] ) ) { // If the API supports offset then it probably -- 2.20.1