Remove error duplication in ApiQueryStashImageInfo by using non hardcoded prefix...
authorSam Reed <reedy@users.mediawiki.org>
Sun, 20 Feb 2011 13:51:24 +0000 (13:51 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 20 Feb 2011 13:51:24 +0000 (13:51 +0000)
includes/api/ApiQueryImageInfo.php
includes/api/ApiQueryStashImageInfo.php

index b764546..cd82be5 100644 (file)
@@ -500,7 +500,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
        public function getPossibleErrors() {
                $p = $this->getModulePrefix();
                return array_merge( parent::getPossibleErrors(), array(
-                       array( 'code' => 'iiurlwidth', 'info' => 'iiurlheight cannot be used without iiurlwidth' ),
+                       array( 'code' => 'iiurlwidth', 'info' => "{$p}urlheight cannot be used without {$p}urlwidth" ),
                        array( 'code' => 'urlparam', 'info' => "Invalid value for {$p}urlparam" ),
                        array( 'code' => 'urlparam_no_width', 'info' => "{$p}urlparam requires {$p}urlwidth" ),
                        array( 'code' => 'urlparam_urlwidth_mismatch', 'info' => "The width set in {$p}urlparm doesnt't " .
index ef649aa..e3fdbea 100644 (file)
@@ -137,12 +137,6 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
                return 'Returns image information for stashed images';
        }
 
-       public function getPossibleErrors() {
-               return array_merge( parent::getPossibleErrors(), array(
-                       array( 'code' => 'siiurlwidth', 'info' => 'siiurlheight cannot be used without iiurlwidth' ),
-               ) );
-       }
-
        protected function getExamples() {
                return array(
                        'api.php?action=query&prop=stashimageinfo&siisessionkey=124sd34rsdf567',