invalidparammix/missingparam get the module prefix twice
authorMatthias Mullie <git@mullie.eu>
Mon, 3 Jun 2013 18:23:16 +0000 (20:23 +0200)
committerMatthias Mullie <git@mullie.eu>
Mon, 3 Jun 2013 18:23:18 +0000 (20:23 +0200)
dieUsage will call encodeParamName, which will already prefix the error code with the module prefix

E.g. for ApiViewFeedbackArticleFeedbackv5 (prefix afvf), this error code was
(incorrectly): afvfafvfinvalidparammix. Should be: afvfinvalidparammix

Change-Id: Ia351678b49e96ef58dce773331ebe9a1b3ebf824

includes/api/ApiBase.php

index c8b05e8..fdf3b76 100644 (file)
@@ -688,9 +688,9 @@ abstract class ApiBase extends ContextSource {
                        array( $this, "parameterNotEmpty" ) ) ), $required );
 
                if ( count( $intersection ) > 1 ) {
-                       $this->dieUsage( "The parameters {$p}" . implode( ", {$p}", $intersection ) . ' can not be used together', "{$p}invalidparammix" );
+                       $this->dieUsage( "The parameters {$p}" . implode( ", {$p}", $intersection ) . ' can not be used together', 'invalidparammix' );
                } elseif ( count( $intersection ) == 0 ) {
-                       $this->dieUsage( "One of the parameters {$p}" . implode( ", {$p}", $required ) . ' is required', "{$p}missingparam" );
+                       $this->dieUsage( "One of the parameters {$p}" . implode( ", {$p}", $required ) . ' is required', 'missingparam' );
                }
        }
 
@@ -724,7 +724,7 @@ abstract class ApiBase extends ContextSource {
                        array( $this, "parameterNotEmpty" ) ) ), $required );
 
                if ( count( $intersection ) > 1 ) {
-                       $this->dieUsage( "The parameters {$p}" . implode( ", {$p}", $intersection ) . ' can not be used together', "{$p}invalidparammix" );
+                       $this->dieUsage( "The parameters {$p}" . implode( ", {$p}", $intersection ) . ' can not be used together', 'invalidparammix' );
                }
        }