From: atif-shaikh Date: Mon, 16 Feb 2015 11:30:32 +0000 (+0530) Subject: CRM-15745 - Notice Fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=26fe6f4c33e1108a3532e6af327aefe605f69bee;p=civicrm-core.git CRM-15745 - Notice Fixes ---------------------------------------- * CRM-15745: "Require Participant Approval" fails on unpaid events w/ confirm screen https://issues.civicrm.org/jira/browse/CRM-15745 --- diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 10f8c2d5d6..3b2dd70a38 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -1169,7 +1169,7 @@ WHERE civicrm_event.is_active = 1 $tplParams['participant_status'] = CRM_Event_PseudoConstant::participantStatus($statusId, NULL, 'label'); } //CRM-15754 - if participant_status contains status ID - elseif (CRM_Utils_Rule::integer($tplParams['participant_status'])) { + elseif (!empty($tplParams['participant_status']) && CRM_Utils_Rule::integer($tplParams['participant_status'])) { $tplParams['participant_status'] = CRM_Event_PseudoConstant::participantStatus($tplParams['participant_status'], NULL, 'label'); } diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index b3f79dd9e6..3d650d26db 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -294,14 +294,16 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) { $lineItemForTemplate = array(); $getTaxDetails = FALSE; - foreach ($this->_lineItem as $key => $value) { - if (!empty($value)) { - $lineItemForTemplate[$key] = $value; - } - if ($invoicing) { - foreach ($value as $v) { - if (isset($v['tax_rate'])) { - $getTaxDetails = TRUE; + if (!empty($this->_lineItem) && is_array($this->_lineItem)) { + foreach ($this->_lineItem as $key => $value) { + if (!empty($value)) { + $lineItemForTemplate[$key] = $value; + } + if ($invoicing) { + foreach ($value as $v) { + if (isset($v['tax_rate'])) { + $getTaxDetails = TRUE; + } } } } diff --git a/CRM/Event/Form/Registration/ThankYou.php b/CRM/Event/Form/Registration/ThankYou.php index 770b6364be..9a1bc5825d 100644 --- a/CRM/Event/Form/Registration/ThankYou.php +++ b/CRM/Event/Form/Registration/ThankYou.php @@ -102,14 +102,16 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { $taxAmount = 0; if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) { $lineItemForTemplate = array(); - foreach ($this->_lineItem as $key => $value) { - if (!empty($value)) { - $lineItemForTemplate[$key] = $value; - if ($invoicing) { - foreach ($value as $v) { - if (isset($v['tax_amount']) || isset($v['tax_rate'])) { - $taxAmount += $v['tax_amount']; - $getTaxDetails = TRUE; + if (!empty($this->_lineItem) && is_array($this->_lineItem)) { + foreach ($this->_lineItem as $key => $value) { + if (!empty($value)) { + $lineItemForTemplate[$key] = $value; + if ($invoicing) { + foreach ($value as $v) { + if (isset($v['tax_amount']) || isset($v['tax_rate'])) { + $taxAmount += $v['tax_amount']; + $getTaxDetails = TRUE; + } } } }