From: JKingsnorth Date: Tue, 17 May 2016 12:17:02 +0000 (+0100) Subject: CRM-18397: Remove unnecessary check and add comments for future changes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5329bf022ddcf08cdaeb7bf292a1facfbcae058c;p=civicrm-core.git CRM-18397: Remove unnecessary check and add comments for future changes --- diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 1ef3429c1e..d5e5044655 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -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; }