[NFC] Fix test failures on PHP 7.4 caused by either NULL being set for the membership...
authorSeamus Lee <seamuslee001@gmail.com>
Fri, 19 Mar 2021 22:45:52 +0000 (09:45 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Fri, 19 Mar 2021 22:45:52 +0000 (09:45 +1100)
CRM/Member/Form.php
tests/phpunit/CRM/Event/Form/ParticipantTest.php

index 1c9313c16b0f879074cac02796826bc68a3fbb7f..5b65b75372109b9e056ee880d9a3cd02117be327 100644 (file)
@@ -497,7 +497,7 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
   public function testSubmit(array $formValues): void {
     $this->exportedValues = $formValues;
     $this->setContextVariables($formValues);
-    $this->_memType = $formValues['membership_type_id'][1];
+    $this->_memType = !empty($formValues['membership_type_id']) ? $formValues['membership_type_id'][1] : NULL;
     $this->_params = $formValues;
     $this->submit();
   }
index cdb0ae133c6782d223b7b93dfe0b3ceb0c767134..be2c61ffca0eabb9ec400ac168dc0b258465287e 100644 (file)
@@ -351,6 +351,7 @@ class CRM_Event_Form_ParticipantTest extends CiviUnitTestCase {
       $form->_bltID = 5;
       $form->_isPaidEvent = TRUE;
       CRM_Event_Form_EventFees::preProcess($form);
+      $form->assignProcessors();
       $form->buildEventFeeForm($form);
     }
     else {