X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FForm%2FEventFees.php;h=2b15c288cef972ecb51c2c820849c9c0c13e9593;hb=f6d8cb2ff9d8e1ecd9843d735f0657e0c8cd2fca;hp=192e54008e2e0dc187c3b3c4ab110f3a386c6867;hpb=8c20952c7e9195ff138ba1d9515eefec74312586;p=civicrm-core.git diff --git a/CRM/Event/Form/EventFees.php b/CRM/Event/Form/EventFees.php index 192e54008e..2b15c288ce 100644 --- a/CRM/Event/Form/EventFees.php +++ b/CRM/Event/Form/EventFees.php @@ -159,6 +159,7 @@ class CRM_Event_Form_EventFees { if (in_array(get_class($form), [ 'CRM_Event_Form_Participant', + 'CRM_Event_Form_Task_Register', 'CRM_Event_Form_Registration_Register', 'CRM_Event_Form_Registration_AdditionalParticipant', ] @@ -173,7 +174,7 @@ class CRM_Event_Form_EventFees { foreach ($form->_priceSet['fields'] as $key => $val) { foreach ($val['options'] as $keys => $values) { if ($values['is_default']) { - if (get_class($form) != 'CRM_Event_Form_Participant' && !empty($values['is_full'])) { + if (!in_array(get_class($form), ['CRM_Event_Form_Participant', 'CRM_Event_Form_Task_Register']) && !empty($values['is_full'])) { continue; } @@ -254,8 +255,8 @@ class CRM_Event_Form_EventFees { $priceFields = $htmlTypes = $optionValues = []; foreach ($lineItems[$participantID] as $lineId => $items) { - $priceFieldId = CRM_Utils_Array::value('price_field_id', $items); - $priceOptionId = CRM_Utils_Array::value('price_field_value_id', $items); + $priceFieldId = $items['price_field_id'] ?? NULL; + $priceOptionId = $items['price_field_value_id'] ?? NULL; if ($priceFieldId && $priceOptionId) { $priceFields[$priceFieldId][] = $priceOptionId; } @@ -277,7 +278,7 @@ SELECT id, html_type foreach ($lineItems[$participantID] as $lineId => $items) { $fieldId = $items['price_field_id']; - $htmlType = CRM_Utils_Array::value($fieldId, $htmlTypes); + $htmlType = $htmlTypes[$fieldId] ?? NULL; if (!$htmlType) { continue; } @@ -286,7 +287,7 @@ SELECT id, html_type $defaults["price_{$fieldId}"] = $items['qty']; } else { - $fieldOptValues = CRM_Utils_Array::value($fieldId, $priceFields); + $fieldOptValues = $priceFields[$fieldId] ?? NULL; if (!is_array($fieldOptValues)) { continue; }