Merge pull request #23974 from colemanw/filterFieldsAfform
[civicrm-core.git] / CRM / Event / Form / EventFees.php
index 14be8ec5f6e8ba76f251f09d514389b5a240aacc..2b15c288cef972ecb51c2c820849c9c0c13e9593 100644 (file)
@@ -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;
               }