Update for form validation checks
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 7 Sep 2017 21:03:36 +0000 (17:03 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 7 Sep 2017 21:03:36 +0000 (17:03 -0400)
Need to use $GLOBALS for the reason array.

registrations/registrations.php

index 330ba8d..4b966b1 100644 (file)
@@ -375,7 +375,6 @@ if( $Action == "Step3" )
     $v['rate_total'] = money( $charge );
 
     // If this event needs attendees
-
     if( $reg_data['need_attendees'] == 't' )
     {
 
@@ -393,7 +392,7 @@ if( $Action == "Step3" )
 
     // If there's any problems change step back to 2 - Checkout Form
 
-    if( count($reason) > 0 )
+    if( count($GLOBALS['reason']) > 0 )
         $Action = "Step2";
     else
     {
@@ -553,7 +552,7 @@ if( $Action == "Step4" )
             if( empty($ccname) )
                 add_reason( "Name on Card is required" );
 
-            $status = SI_REG_STATUS_CC_PEND;                        // It's OK to set this here since we're not going to process anything unless there's no failure "$reason".
+            $status = SI_REG_STATUS_CC_PEND;                        // It's OK to set this here since we're not going to process anything unless there's no failure "$GLOBALS['reason']".
 
         }
 
@@ -568,7 +567,7 @@ if( $Action == "Step4" )
     if( isset($cc_reason) && $cc_reason != '' )
         add_reason( $cc_reason );
 
-    if( count($reason) > 0 )
+    if( count($GLOBALS['reason']) > 0 )
         $Action = "Step3";
 }
 
@@ -758,8 +757,8 @@ $v["this_day_of_month"]     = $date_array["mday"];
 $v["navigation"]            = $nav;
 $v["form_data"]             = $GLOBALS['form_data'];
 $v["link_data"]             = $link_data;
-$view_tags["reason"]        = $reason;
-$v['have_reason']           = ( count($reason) > 0 ? 'YES' : 'NO' );
+$view_tags["reason"]        = $GLOBALS['reason'];
+$v['have_reason']           = ( count($GLOBALS['reason']) > 0 ? 'YES' : 'NO' );
 $v["problem"]               = "";
 $v["price_debug"]           = "";
 $v["next_step"]             = "Step$next_step";