CRM-14623 notice fixes
authormonishdeb <monish.deb@webaccess.co.in>
Mon, 19 May 2014 13:11:12 +0000 (18:41 +0530)
committermonishdeb <monish.deb@webaccess.co.in>
Mon, 19 May 2014 13:11:12 +0000 (18:41 +0530)
----------------------------------------
* 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
CRM/Event/Form/Registration/Register.php
CRM/Price/BAO/LineItem.php

index e70c86b4e5423f2b800c929b26c2543fc15cb3bc..baa0440b6fd2375d0bcbb844db51e97274aa3b51 100644 (file)
@@ -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',
index aba61f1c5ede1e0a04f915a630b097cb6fe5daa5..a0285f00e80a57a7a81179f0376c32ecba4b8195 100644 (file)
@@ -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
index 20ff8f740ec0f5c83071b685928963100326df58..71485f42ed7f074e05159e0d1662cfbb5b65a1f9 100644 (file)
@@ -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');
       }
     }