From 1b13cc1236aebecdea612c73e562c5ac18595e61 Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Thu, 28 Jul 2016 10:15:07 -0700 Subject: [PATCH] Rename OpenSearch qiprofile parameter back to profile In I6f987db this parameter was inadvertantly renamed to qiprofile. The qiprofile is something different, and is also a BC break. The BC break is pretty minor, for a randomly chosen day this looks to be used 157 times out of 28.7M requests, but since this really isn't a qiprofile rename it back to what it was. Change-Id: I1cc07945888c15ea4b4c9596eea447b706606fae --- includes/api/ApiOpenSearch.php | 2 +- tests/phpunit/includes/api/ApiOpenSearchTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php index b13ba58653..ace776c923 100644 --- a/includes/api/ApiOpenSearch.php +++ b/includes/api/ApiOpenSearch.php @@ -294,7 +294,7 @@ class ApiOpenSearch extends ApiBase { public function getSearchProfileParams() { return [ - 'qiprofile' => [ + 'profile' => [ 'profile-type' => SearchEngine::COMPLETION_PROFILE_TYPE, 'help-message' => 'apihelp-query+prefixsearch-param-profile' ], diff --git a/tests/phpunit/includes/api/ApiOpenSearchTest.php b/tests/phpunit/includes/api/ApiOpenSearchTest.php index fd5b3a9998..39e90c2e33 100644 --- a/tests/phpunit/includes/api/ApiOpenSearchTest.php +++ b/tests/phpunit/includes/api/ApiOpenSearchTest.php @@ -30,8 +30,8 @@ class ApiOpenSearchTest extends MediaWikiTestCase { $params = $api->getAllowedParams(); $this->assertArrayNotHasKey( 'offset', $params ); - $this->assertArrayHasKey( 'qiprofile', $params, print_r( $params, true ) ); - $this->assertEquals( 'normal', $params['qiprofile'][ApiBase::PARAM_DFLT] ); + $this->assertArrayHasKey( 'profile', $params, print_r( $params, true ) ); + $this->assertEquals( 'normal', $params['profile'][ApiBase::PARAM_DFLT] ); } private function replaceSearchEngineConfig() { -- 2.20.1