ApiOpenSearch: Pass second argument to ApiResult::removeValue()
authorKunal Mehta <legoktm@gmail.com>
Sat, 16 May 2015 21:25:22 +0000 (14:25 -0700)
committerKunal Mehta <legoktm@gmail.com>
Sat, 16 May 2015 21:26:11 +0000 (14:26 -0700)
If $name is null, it will use $path ('warnings').

Bug: T99375
Change-Id: Iad295d2f560d1cc043f7fa64cf402983d4b0e6bd

includes/api/ApiOpenSearch.php

index 16d8b55..a93b7cc 100644 (file)
@@ -384,7 +384,7 @@ class ApiOpenSearchFormatJson extends ApiFormatJson {
 
        public function execute() {
                if ( !$this->getResult()->getResultData( 'error' ) ) {
-                       $warnings = $this->getResult()->removeValue( 'warnings' );
+                       $warnings = $this->getResult()->removeValue( 'warnings', null );
                        if ( $this->warningsAsError && $warnings ) {
                                $this->dieUsage(
                                        'Warnings cannot be represented in OpenSearch JSON format', 'warnings', 0,