From f12392c866e8cd5ca4adacce4e93c431e6c1349b Mon Sep 17 00:00:00 2001 From: "Matthew Wire (MJW Consulting)" Date: Tue, 11 Jun 2019 18:41:17 +0100 Subject: [PATCH] Comments and formatting only --- CRM/Contact/BAO/Contact.php | 4 +++- CRM/Core/Form.php | 2 ++ CRM/Event/Form/Registration.php | 4 +--- CRM/Event/Form/Registration/Confirm.php | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 7d14338e4c..e59bac15f1 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -549,13 +549,15 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); * Add billing fields to the params if appropriate. * * If we have ANY name fields then we want to ignore all the billing name fields. However, if we - * don't then we should set the name fields to the filling fields AND add the preserveDBName + * don't then we should set the name fields to the billing fields AND add the preserveDBName * parameter (which will tell the BAO only to set those fields if none already exist. * * We specifically don't want to set first name from billing and last name form an on-page field. Mixing & * matching is best done by hipsters. * * @param array $params + * + * @fixme How does this relate to almost the same thing being done in CRM_Core_Form::formatParamsForPaymentProcessor() */ public static function addBillingNameFieldsIfOtherwiseNotSet(&$params) { $nameFields = array('first_name', 'middle_name', 'last_name', 'nick_name', 'prefix_id', 'suffix_id'); diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 91d8cf8830..d55dfd9751 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -837,6 +837,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $this->_params = array_merge($this->_params, $addressParams); } + // @fixme it would be really nice to have a comment here so I had a clue why we are setting $fields[$name] = 1 + // Also how does relate to similar code in CRM_Contact_BAO_Contact::addBillingNameFieldsIfOtherwiseNotSet() $nameFields = ['first_name', 'middle_name', 'last_name']; foreach ($nameFields as $name) { $fields[$name] = 1; diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index af19e44236..40ead8649f 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -519,9 +519,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { // also assign all participantIDs to the template // useful in generating confirmation numbers if needed - $this->assign('participantIDs', - $this->_participantIDS - ); + $this->assign('participantIDs', $this->_participantIDS); } /** diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 1b35d29fe3..6dabd086b4 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -180,6 +180,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { CRM_Utils_System::setTitle($this->_values['event']['confirm_title']); } + // Personal campaign page if ($this->_pcpId) { $params = CRM_Contribute_Form_Contribution_Confirm::processPcp($this, $this->_params[0]); $this->_params[0] = $params; -- 2.25.1