From: Brion Vibber Date: Tue, 27 Jan 2009 20:39:24 +0000 (+0000) Subject: Pulling back r46341 and r46342 for now "API: (bug 17142) Add redirects parameter... X-Git-Tag: 1.31.0-rc.0~43204 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=79d0c8e34be50276e90faea050dc544ff806f760;p=lhc%2Fweb%2Fwiklou.git Pulling back r46341 and r46342 for now "API: (bug 17142) Add redirects parameter to action=opensearch to control redirect resolution. Changes to OpenSearchXML extension in next commit" Mysteriously there's no way to get a boolean parameter to default to true, which leads to an incompatibility in the sensible behavior of the more detailed responses in the XML output -- eg you get a whole buttload of "#REDIRECT Blabla" in your results, which is absolutely hideous. This is very much not desireable. :) If we could change the default, and allow it to be set on or off for specific requests if some person for some reason is doing highly customized suggestion searches and wants it configured differently (no idea why), that might be doable. But as written this doesn't make any sense. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c01074d3bb..51984cd77e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -114,8 +114,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 17069) Added ucshow=patrolled|!patrolled to list=usercontribs * action=delete respects $wgDeleteRevisionsLimit and the bigdelete user right * (bug 15949) Add undo functionality to action=edit -* (bug 17142) Added redirects parameter to action=opensearch to control redirect - resolution === Languages updated in 1.15 === diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php index 50e82c05ca..4a673c2154 100644 --- a/includes/api/ApiOpenSearch.php +++ b/includes/api/ApiOpenSearch.php @@ -51,20 +51,6 @@ class ApiOpenSearch extends ApiBase { $this->getMain()->setCacheMaxAge(1200); $srchres = PrefixSearch::titleSearch( $search, $limit, $namespaces ); - - if( $params['redirects'] ) { - foreach( $srchres as &$t ) { - $title = Title::newFromText( $t ); - if( is_null( $title ) ) { - continue; - } - $article = new Article( $title ); - $redirTitle = $article->getRedirectTarget(); - if( !is_null( $redirTitle ) ) { - $t = $redirTitle->getPrefixedText(); - } - } - } // Set top level elements $result = $this->getResult(); @@ -87,7 +73,6 @@ class ApiOpenSearch extends ApiBase { ApiBase :: PARAM_TYPE => 'namespace', ApiBase :: PARAM_ISMULTI => true ), - 'redirects' => false, ); } @@ -96,7 +81,6 @@ class ApiOpenSearch extends ApiBase { 'search' => 'Search string', 'limit' => 'Maximum amount of results to return', 'namespace' => 'Namespaces to search', - 'redirects' => 'Resolve redirects', ); }