Ejegg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/276014
Change subject: Fix bug so we use invalid amount error
......................................................................
Fix bug so we use invalid amount error
Its message key doesn't have -calc on the end of it.
Bug: T129277
Change-Id: I2a0c3d593375fadf082b6ea57ad0763e68161747
---
M gateway_common/DataValidator.php
1 file changed, 7 insertions(+), 8 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface
refs/changes/14/276014/1
diff --git a/gateway_common/DataValidator.php b/gateway_common/DataValidator.php
index c9330fa..65edf60 100644
--- a/gateway_common/DataValidator.php
+++ b/gateway_common/DataValidator.php
@@ -145,18 +145,17 @@
//getErrorToken is actually for something entirely
different:
//Figuring out where on the form the error should land.
$token = self::getErrorToken( $field );
- $suffix = $token; //defaultness
- switch ($token){
- case 'amount':
- $suffix = 'invalid-amount';
+ switch ( $token ) {
+ case 'amount':
+ $error_key_calc =
'donate_interface-error-msg-invalid-amount';
+ break;
+ default:
+ $error_key_calc =
'donate_interface-error-msg-' . $token . '-calc';
break;
}
- $error_key_calc = 'donate_interface-error-msg-' .
$suffix . '-calc';
-
- if ( $type === 'calculated'){
+ if ( $type === 'calculated' ){
// try for the special "calculated" error
message.
- // Note: currently only used for country
if ( MessageUtils::messageExists(
$error_key_calc, $language ) ) {
return WmfFramework::formatMessage(
$error_key_calc );
}
--
To view, visit https://gerrit.wikimedia.org/r/276014
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a0c3d593375fadf082b6ea57ad0763e68161747
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits