CRM-15745 - Notice Fixes
authoratif-shaikh <shaikh388@gmail.com>
Mon, 16 Feb 2015 11:30:32 +0000 (17:00 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Mon, 16 Feb 2015 11:30:32 +0000 (17:00 +0530)
----------------------------------------
* CRM-15745: "Require Participant Approval" fails on unpaid events w/ confirm screen
  https://issues.civicrm.org/jira/browse/CRM-15745

CRM/Event/BAO/Event.php
CRM/Event/Form/Registration/Confirm.php
CRM/Event/Form/Registration/ThankYou.php

index 10f8c2d5d68000e0c4708dcdf4c65a766053a17b..3b2dd70a38fd7a63c4ac251bdda2b15eb4492742 100644 (file)
@@ -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');
         }
 
index b3f79dd9e603eb15a491c8765e5a99c12f961154..3d650d26db6d12cfb3edb2c05c18b14bc002fb97 100644 (file)
@@ -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;
+              }
             }
           }
         }
index 770b6364be81444fcb3fa333b9325209bd3f231c..9a1bc5825db582db6abf1b02ef2b73df70a69cbf 100644 (file)
@@ -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;
+                }
               }
             }
           }