systopia / de.systopia.donrec

CiviCRM Donation Receipts Extension
GNU Affero General Public License v3.0
15 stars 26 forks source link

Error executing "donrec_testrun" button on PHP 8.1 / Civi 5.69 + Smarty3 #195

Closed CsarRamos closed 6 months ago

CsarRamos commented 6 months ago

Hello I have detected an error in the code when executing a receipt execution test.

Its related with php 8.1 and CiviCRM 5.69.

TypeError: array_keys(): Argument #1 ($array) must be of type array, null given en array_keys() (línea 284 de civi/vendor/civicrm/civicrm-core/CRM/Core/Smarty.php)
#0 civi/vendor/civicrm/civicrm-core/CRM/Core/Smarty.php(284): array_keys()
#1 civi/vendor/civicrm/donrec/CRM/Donrec/Logic/Template.php(215): CRM_Core_Smarty->clearTemplateVars()
#2 civi/vendor/civicrm/donrec/CRM/Donrec/Exporters/BasePDF.php(58): CRM_Donrec_Logic_Template->generatePDF()
#3 civi/vendor/civicrm/donrec/CRM/Donrec/Logic/Engine.php(174): CRM_Donrec_Exporters_BasePDF->exportSingle()
#4 civi/vendor/civicrm/donrec/api/v3/DonationReceiptEngine/Next.php(36): CRM_Donrec_Logic_Engine->nextStep()
#5 civi/vendor/civicrm/civicrm-core/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_donation_receipt_engine_next()
#6 civi/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(156): Civi\API\Provider\MagicFunctionProvider->invoke()
#7 civi/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(79): Civi\API\Kernel->runRequest()
#8 civi/vendor/civicrm/civicrm-core/api/api.php(28): Civi\API\Kernel->runSafe()
#9 civi/vendor/civicrm/civicrm-core/CRM/Utils/REST.php(288): civicrm_api()
#10 civi/vendor/civicrm/civicrm-core/CRM/Utils/REST.php(533): CRM_Utils_REST::process()
#11 civi/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(288): CRM_Utils_REST::ajax()
#12 civi/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem()
#13 civi/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke()
#14 civi/web/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke()
#15 civi/web/modules/contrib/civicrm/src/Controller/CivicrmController.php(83): Drupal\civicrm\Civicrm->invoke()
#16 [internal function]: Drupal\civicrm\Controller\CivicrmController->main()
#17 civi/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#18 civi/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#19 civi/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#20 civi/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): 

This seems to be the cause of the error, I will see if I can find a solution to help:

I found some related info to this method:

CsarRamos commented 6 months ago

It seems that issue is fixed from 5.71: https://github.com/civicrm/civicrm-core/commit/500b1c472a297ea13a7aaae4497ace08c0b44010

Best regards.

jensschuppe commented 6 months ago

Just tagging bug and wontfix as there seems to be an incompatibility with certain Core versions, that we won't address in this extension.