From ecdfa87bc30ad52151ad8c080eb9bbccc242d363 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 15 Oct 2019 21:50:26 +1300 Subject: [PATCH] [REF] remove obsolete code. On trying to look into a bug around this code I realised that there is quite a bit of code that does nothing. These lines exist to build the variable - which is never used. Hence they can go. I also spotted scriptArray is never used either - this stuff came from svn before everyone was using IDEs that highlighted unused lines --- .../Registration/AdditionalParticipant.php | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/CRM/Event/Form/Registration/AdditionalParticipant.php b/CRM/Event/Form/Registration/AdditionalParticipant.php index 25f273cbaf71..b09b13ff3b80 100644 --- a/CRM/Event/Form/Registration/AdditionalParticipant.php +++ b/CRM/Event/Form/Registration/AdditionalParticipant.php @@ -180,32 +180,6 @@ public function buildQuickForm() { if ($this->_values['event']['is_monetary']) { CRM_Event_Form_Registration_Register::buildAmount($this); } - $first_name = $last_name = NULL; - $pre = $post = []; - foreach ([ - 'pre', - 'post', - ] as $keys) { - if (isset($this->_values['additional_custom_' . $keys . '_id'])) { - $this->buildCustom($this->_values['additional_custom_' . $keys . '_id'], 'additionalCustom' . ucfirst($keys)); - $$keys = CRM_Core_BAO_UFGroup::getFields($this->_values['additional_custom_' . $keys . '_id']); - } - foreach ([ - 'first_name', - 'last_name', - ] as $name) { - if (array_key_exists($name, $$keys) && - CRM_Utils_Array::value('is_required', CRM_Utils_Array::value($name, $$keys)) - ) { - $$name = 1; - } - } - } - - $required = ($button == 'skip' || - $this->_values['event']['allow_same_participant_emails'] == 1 && - ($first_name && $last_name) - ) ? FALSE : TRUE; //add buttons $js = NULL;