Pulling back r46341 and r46342 for now "API: (bug 17142) Add redirects parameter...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 27 Jan 2009 20:39:24 +0000 (20:39 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 27 Jan 2009 20:39:24 +0000 (20:39 +0000)
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.

RELEASE-NOTES
includes/api/ApiOpenSearch.php

index c01074d..51984cd 100644 (file)
@@ -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 ===
 
index 50e82c0..4a673c2 100644 (file)
@@ -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',
                );
        }