From 52f3b44beeb514000c2a0b6013802a901b1f0c56 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 4 Jan 2016 22:10:14 -0500 Subject: [PATCH] CRM-14106 - Swap CRM_Utils_Array::value for empty() when cast to boolean --- CRM/Event/Form/Participant.php | 2 +- CRM/Utils/Wrapper.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 1c0f840f11..edbfd0da54 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -1668,7 +1668,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment 'groupName' => 'msg_tpl_workflow_event', 'valueName' => 'event_offline_receipt', 'contactId' => $contactID, - 'isTest' => (bool) CRM_Utils_Array::value('is_test', $this->_defaultValues), + 'isTest' => !empty($this->_defaultValues['is_test']), 'PDFFilename' => ts('confirmation') . '.pdf', ); diff --git a/CRM/Utils/Wrapper.php b/CRM/Utils/Wrapper.php index 5211aa68f7..29ace3332e 100644 --- a/CRM/Utils/Wrapper.php +++ b/CRM/Utils/Wrapper.php @@ -62,10 +62,10 @@ class CRM_Utils_Wrapper { public function run($formName, $formLabel = NULL, $arguments = NULL) { if (is_array($arguments)) { $mode = CRM_Utils_Array::value('mode', $arguments); - $imageUpload = (bool) CRM_Utils_Array::value('imageUpload', $arguments, FALSE); - $addSequence = (bool) CRM_Utils_Array::value('addSequence', $arguments, FALSE); - $attachUpload = (bool) CRM_Utils_Array::value('attachUpload', $arguments, FALSE); - $ignoreKey = (bool) CRM_Utils_Array::value('ignoreKey', $arguments, FALSE); + $imageUpload = !empty($arguments['imageUpload']); + $addSequence = !empty($arguments['addSequence']); + $attachUpload = !empty($arguments['attachUpload']); + $ignoreKey = !empty($arguments['ignoreKey']); } else { $arguments = array(); -- 2.25.1