CRM-18397: Remove unnecessary check and add comments for future changes
authorJKingsnorth <john@johnkingsnorth.co.uk>
Tue, 17 May 2016 12:17:02 +0000 (13:17 +0100)
committerJKingsnorth <john@johnkingsnorth.co.uk>
Tue, 17 May 2016 12:17:02 +0000 (13:17 +0100)
CRM/Event/Form/Registration/Confirm.php

index 1ef3429c1e185c04170d6a7499f62f54a2a2df1e..d5e5044655c31a98e5206bcc650f8fdf446264b6 100644 (file)
@@ -1054,7 +1054,10 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
 
     // If there's no 'first_name' in the profile then overwrite the names from
     // the billing fields (if they are set)
-    // @todo This logic is flawed, at least check each field??
+    // @todo Reconcile with the contribution method formatParamsForPaymentProcessor
+    // rather than adding different logic to check when to keep the billing
+    // fields. There might be a difference in handling guest/multiple
+    // participants though.
     if (is_array($fields)) {
       if (!array_key_exists('first_name', $fields)) {
         $nameFields = array('first_name', 'middle_name', 'last_name');
@@ -1069,7 +1072,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
     }
 
     // Add the billing names to the billing address, if a billing name is set
-    if ($form->_values['event']['is_monetary'] && !empty($params['billing_first_name'])) {
+    if (!empty($params['billing_first_name'])) {
       $params["address_name-{$form->_bltID}"] = CRM_Utils_Array::value('billing_first_name', $params) . ' ' . CRM_Utils_Array::value('billing_middle_name', $params) . ' ' . CRM_Utils_Array::value('billing_last_name', $params);
       $fields["address_name-{$form->_bltID}"] = 1;
     }