Katie Horn has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/99772


Change subject: Unborking the payments form chooser
......................................................................

Unborking the payments form chooser

Change-Id: If3b88dfd0e10b43e7c48dcdc41f1959928daee66
---
M gateway_common/gateway.adapter.php
M gateway_forms/RapidHtml.php
M special/GatewayFormChooser.php
3 files changed, 14 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/72/99772/1

diff --git a/gateway_common/gateway.adapter.php 
b/gateway_common/gateway.adapter.php
index 2cc8be1..ae8bb0e 100644
--- a/gateway_common/gateway.adapter.php
+++ b/gateway_common/gateway.adapter.php
@@ -3095,6 +3095,11 @@
 
                $ffname = $data['ffname'];
 
+               //easy stuff first:
+               if ( $this->isValidSpecialForm( $ffname ) ) {
+                       return;
+               }
+
 //             'country' might = 'XX'
                $country = $data['country'];
                if ( $country === 'XX' ) {
@@ -3118,7 +3123,7 @@
                        $this->addData( array ( 'ffname' => $ffname . 
"-$country" ) );
 
                        //I'm only doing this for serious legacy purposes. This 
mess needs to stop itself. To help with the mess-stopping...
-                       $message = "ffname '$ffname' was invalid, but the 
country-specific '$ffname . -$country' works. utm_source = '$utm', referrer = 
'$ref'";
+                       $message = "ffname '$ffname' was invalid, but the 
country-specific '$ffname-$country' works. utm_source = '$utm', referrer = 
'$ref'";
                        $this->log( $this->getLogMessagePrefix() . $message, 
LOG_WARNING );
                } else {
                        //Invalid form. Go get one that is valid, and squak in 
the error logs.
diff --git a/gateway_forms/RapidHtml.php b/gateway_forms/RapidHtml.php
index d1f05cf..c000f46 100644
--- a/gateway_forms/RapidHtml.php
+++ b/gateway_forms/RapidHtml.php
@@ -126,7 +126,7 @@
                                $this->set_html_file_path( $ffname );
                        } catch ( MWException $mwe ) {
                                $message = 
$this->gateway->getLogMessagePrefix() . "Could not load form '$ffname'";
-                               $this->log( $message, LOG_ERR );
+                               $this->gateway->log( $message, LOG_ERR );
                        }
                }
 
diff --git a/special/GatewayFormChooser.php b/special/GatewayFormChooser.php
index a81523f..aae8e5b 100644
--- a/special/GatewayFormChooser.php
+++ b/special/GatewayFormChooser.php
@@ -238,7 +238,13 @@
                                        continue;
                                }
                        }
-                       
+
+                       // NOOOOES.
+                       // ...but actually yes.
+                       if ( $recurring === 'false' || $recurring === '0' ) {
+                               $recurring = false;
+                       }
+
                        //filter on recurring
                        if ( DataValidator::value_appears_in( 'recurring', 
$meta ) !== ( bool ) $recurring ) {
                                unset( $forms[$name] );

-- 
To view, visit https://gerrit.wikimedia.org/r/99772
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3b88dfd0e10b43e7c48dcdc41f1959928daee66
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Katie Horn <kh...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to