From 52ecc8d9b50d7901fe6d4ab2f9bf2575c1e6111f Mon Sep 17 00:00:00 2001 From: Matthias Mullie Date: Mon, 3 Jun 2013 20:23:16 +0200 Subject: [PATCH] invalidparammix/missingparam get the module prefix twice 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index c8b05e84de..fdf3b7666b 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -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' ); } } -- 2.20.1