Fix php 7.2 countable warning
authoreileen <emcnaughton@wikimedia.org>
Mon, 7 Jan 2019 22:32:03 +0000 (11:32 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 7 Jan 2019 22:53:32 +0000 (11:53 +1300)
per https://lab.civicrm.org/dev/core/issues/406#note_12393
Warning: count(): Parameter must be an array or an object that implements Countable in CRM_Event_Form_Participant->submit() (line 1722 of .../all/modules/civicrm/CRM/Event/Form/Participant.php).

CRM/Event/Form/Participant.php

index b8b9b68abcabef7d370dcd8bb730b4a49a016dff..fdb9cacd845afaa6d50c377ba35221856404283b 100644 (file)
@@ -1719,7 +1719,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         );
         $prefixValue = Civi::settings()->get('contribution_invoice_settings');
         $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
-        if (count($taxAmt) > 0 && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
+        if (!empty($taxAmt) && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
           $sendTemplateParams['isEmailPdf'] = TRUE;
           $sendTemplateParams['contributionId'] = $contributionId;
         }