From e03317f1da4daddc9ada288d9a4107fc863220d3 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Mon, 19 May 2014 18:41:12 +0530 Subject: [PATCH] CRM-14623 notice fixes ---------------------------------------- * CRM-14623: PHP Notices when registering a participant in the back end for an event that uses a price set with max participants https://issues.civicrm.org/jira/browse/CRM-14623 --- CRM/Event/Form/Participant.php | 2 +- CRM/Event/Form/Registration/Register.php | 2 +- CRM/Price/BAO/LineItem.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index e70c86b4e5..baa0440b6f 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -1162,7 +1162,7 @@ class CRM_Event_Form_Participant extends CRM_Contact_Form_Task { $contactID = CRM_Contact_BAO_Contact::createProfileContact($params, $fields, $this->_contactId, NULL, NULL, $ctype); } - if ($this->_params['participant_role_id']) { + if (!empty($this->_params['participant_role_id'])) { $customFieldsRole = array(); foreach ($this->_params['participant_role_id'] as $roleKey) { $customFieldsRole = CRM_Utils_Array::crmArrayMerge(CRM_Core_BAO_CustomField::getFields('Participant', diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index aba61f1c5e..a0285f00e8 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -702,7 +702,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { } $skipParticipants = $formattedPriceSetDefaults = array(); - if ($form->_allowConfirmation && (isset($form->_pId) || isset($form->_additionalParticipantId))) { + if (!empty($form->_allowConfirmation) && (isset($form->_pId) || isset($form->_additionalParticipantId))) { $participantId = isset($form->_pId) ? $form->_pId : $form->_additionalParticipantId; $pricesetDefaults = CRM_Event_Form_EventFees::setDefaultPriceSet($participantId, $form->_eventId diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 20ff8f740e..71485f42ed 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -248,7 +248,7 @@ AND li.entity_id = {$entityId} 'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $options[$oid]), ); - if ($values[$oid]['membership_type_id'] && !isset($values[$oid]['auto_renew'])) { + if ($values[$oid]['membership_type_id'] && empty($values[$oid]['auto_renew'])) { $values[$oid]['auto_renew'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $values[$oid]['membership_type_id'], 'auto_renew'); } } -- 2.25.1