TypeError: trim(): Argument #1 ($string) must be of type string, array given
CiviCRM 5.58.1. CiviDiscount 3.7 Drupal Version 9.5.8 PHP 8.0.28
View an event registration Click on 'Change selections' Goes to eg https:///civicrm/event/participant/feeselection?reset=1&id=5622&cid=4545&action=update Get white screen 'The website encountered an unexpected error. Please try again later.'
Watchdog error: TypeError: trim(): Argument #1 ($string) must be of type string, array given in trim() (line 66 of ///drupal9/web/sites/default/civicrm_extensions/contrib/org.civicrm.module.cividiscount-3.7/CRM/CiviDiscount/DiscountCalculator.php) #0 ///drupal9/web/sites/default/civicrm_extensions/contrib/org.civicrm.module.cividiscount-3.7/CRM/CiviDiscount/DiscountCalculator.php(66): trim() #1 ///drupal9/web/sites/default/civicrm_extensions/contrib/org.civicrm.module.cividiscount-3.7/cividiscount.php(333): CRM_CiviDiscount_DiscountCalculator->__construct() #2 ///drupal9/vendor/civicrm/civicrm-core/CRM/Utils/Hook.php(279): cividiscount_civicrm_buildAmount() #3 (closed) ///drupal9/vendor/civicrm/civicrm-core/CRM/Utils/Hook/DrupalBase.php(73): CRM_Utils_Hook->runHooks() #4 (closed) ///drupal9/vendor/civicrm/civicrm-core/Civi/Core/CiviEventDispatcher.php(314): CRM_Utils_Hook_DrupalBase->invokeViaUF() #5 ///drupal9/vendor/symfony/event-dispatcher/EventDispatcher.php(251): Civi\Core\CiviEventDispatcher::delegateToUF() #6 ///drupal9/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners() #7 ///drupal9/vendor/civicrm/civicrm-core/Civi/Core/CiviEventDispatcher.php(260): Symfony\Component\EventDispatcher\EventDispatcher->dispatch() #8 ///drupal9/vendor/civicrm/civicrm-core/CRM/Utils/Hook.php(167): Civi\Core\CiviEventDispatcher->dispatch() #9 ///drupal9/vendor/civicrm/civicrm-core/CRM/Utils/Hook.php(835): CRM_Utils_Hook->invoke() #10 (closed) ///drupal9/vendor/civicrm/civicrm-core/CRM/Event/Form/Registration/Register.php(587): CRM_Utils_Hook::buildAmount() #11 (closed) ///drupal9/vendor/civicrm/civicrm-core/CRM/Event/Form/ParticipantFeeSelection.php(160): CRM_Event_Form_Registration_Register::buildAmount() #12 (closed) ///drupal9/vendor/civicrm/civicrm-core/CRM/Core/Form.php(689): CRM_Event_Form_ParticipantFeeSelection->buildQuickForm() #13 (closed) ///drupal9/vendor/civicrm/civicrm-core/CRM/Core/QuickForm/Action/Display.php(76): CRM_Core_Form->buildForm() #14 ///drupal9/vendor/civicrm/civicrm-packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform() #15 ///drupal9/vendor/civicrm/civicrm-packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle() #16 ///drupal9/vendor/civicrm/civicrm-core/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle() #17 ///drupal9/vendor/civicrm/civicrm-core/CRM/Utils/Wrapper.php(98): CRM_Core_Controller->run() #18 ///drupal9/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(292): CRM_Utils_Wrapper->run() #19 ///drupal9/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem() #20 ///drupal9/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke() #21 ///drupal9/web/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke() #22 ///drupal9/web/modules/contrib/civicrm/src/Controller/CivicrmController.php(80): Drupal\civicrm\Civicrm->invoke() #23 (closed) [internal function]: Drupal\civicrm\Controller\CivicrmController->main() #24 (closed) ///drupal9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array() #25 ///drupal9/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() #26 ///drupal9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext() #27 (closed) ///drupal9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() #28 ///drupal9/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() #29 ///drupal9/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw() #30 ///drupal9/web/modules/contrib/force_password_change/src/Service/ForcePasswordChangeRedirectMiddleware.php(42): Symfony\Component\HttpKernel\HttpKernel->handle() #31 ///drupal9/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Drupal\force_password_change\Service\ForcePasswordChangeRedirectMiddleware->handle() #32 (closed) ///drupal9/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle() #33 ///drupal9/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle() #34 ///drupal9/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass() #35 (closed) ///drupal9/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle() #36 ///drupal9/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() #37 (closed) ///drupal9/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() #38 (closed) ///drupal9/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle() #39 (closed) ///drupal9/web/index.php(19): Drupal\Core\DrupalKernel->handle() #40 {main}