systopia / de.systopia.eventmessages

CiviCRM Custom Event Communication Extension
Other
4 stars 6 forks source link

Error thrown, no email sent after latest core update #47

Open tomasisainmdom opened 7 months ago

tomasisainmdom commented 7 months ago

After the latest CiviCRM core update, the custom event message is throwing an error and failing to send the designated email. The intended operation is to send an email when 'Participant Status' is changed from one state to another (in this case it's "Invited" to "Will Attend"). When I update the participant record I get the following error onscreen: "Error - Sorry an error occurred and your information was not saved". In actuality the status update is successfully changed and saved, however the custom email message is no longer sent. I then get a follow email from a WordPress plugin detailing the error (below this message). Unfortunately, I can't make heads or tails of it....

In terms of troubleshooting I can confirm the following:

Any insight?

WordPress version 6.4.3 Active theme: Hello Elementor (version 2.4.2.1642712871) Current plugin: CiviCRM (version 5.69.3) PHP version 8.1.23

Error Details

An error of type E_ERROR was caused in line 90 of the file /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/WorkflowMessage/WorkflowMessage.php. Error message: Uncaught TypeError: Civi\WorkflowMessage\WorkflowMessage::importAll(): Argument #1 ($model) must be of type Civi\WorkflowMessage\WorkflowMessageInterface, array given, called in /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/MessageTemplate.php on line 358 and defined in /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/WorkflowMessage/WorkflowMessage.php:90
Stack trace:
#0 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/MessageTemplate.php(358): Civi\WorkflowMessage\WorkflowMessage::importAll(Array, Array)
#1 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/MessageTemplate.php(422): CRM_Core_BAO_MessageTemplate::renderTemplateRaw(Array)
#2 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/api/v3/MessageTemplate.php(126): CRM_Core_BAO_MessageTemplate::sendTemplate(Array)
#3 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_message_template_send(Array)
#4 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(156): Civi\API\Provider\MagicFunctionProvider->invoke(Array)
#5 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(79): Civi\API\Kernel->runRequest(Array)
#6 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/api/api.php(136): Civi\API\Kernel->runSafe('MessageTemplate', 'send', Array)
#7 /home/[MYDOMAIN]/www/www/wp-content/uploads/civicrm/ext/de.systopia.eventmessages/CRM/Eventmessages/SendMail.php(100): civicrm_api3('MessageTemplate', 'send', Array)
#8 /home/[MYDOMAIN]/www/www/wp-content/uploads/civicrm/ext/de.systopia.eventmessages/CRM/Eventmessages/Logic.php(305): CRM_Eventmessages_SendMail::sendMessageTo(Array)
#9 /home/[MYDOMAIN]/www/www/wp-content/uploads/civicrm/ext/de.systopia.eventmessages/CRM/Eventmessages/Logic.php(85): CRM_Eventmessages_Logic::processStatusChange(40, 20, 21, 634)
#10 /home/[MYDOMAIN]/www/www/wp-content/uploads/civicrm/ext/de.systopia.eventmessages/eventmessages.php(104): CRM_Eventmessages_Logic::recordPostCommit(634, Object(CRM_Event_BAO_Participant))
#11 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(288): eventmessages_civicrm_postCommit('edit', 'Participant', 634, Object(CRM_Event_BAO_Participant), NULL)
#12 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook/WordPress.php(136): CRM_Utils_Hook->runHooks(Array, 'civicrm_postCom...', 5, 'edit', 'Participant', 634, Object(CRM_Event_BAO_Participant), NULL, NULL)
#13 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(326): CRM_Utils_Hook_WordPress->invokeViaUF(5, 'edit', 'Participant', 634, Object(CRM_Event_BAO_Participant), NULL, NULL, 'civicrm_postCom...')
#14 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(251): Civi\Core\CiviEventDispatcher::delegateToUF(Object(Civi\Core\Event\PostEvent), 'hook_civicrm_po...', Object(Civi\Core\UnoptimizedEventDispatcher))
#15 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'hook_civicrm_po...', Object(Civi\Core\Event\PostEvent))
#16 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(263): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Civi\Core\Event\PostEvent), 'hook_civicrm_po...')
#17 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(401): Civi\Core\CiviEventDispatcher->dispatch('hook_civicrm_po...', Object(Civi\Core\Event\PostEvent))
#18 [internal function]: CRM_Utils_Hook::postCommit('edit', 'Participant', 634, Object(CRM_Event_BAO_Participant))
#19 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/Transaction/Frame.php(198): call_user_func_array(Array, Array)
#20 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/Transaction/Frame.php(148): Civi\Core\Transaction\Frame->invokeCallbacks(2)
#21 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/Transaction/Manager.php(103): Civi\Core\Transaction\Frame->finish()
#22 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Transaction.php(126): Civi\Core\Transaction\Manager->dec()
#23 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Event/BAO/Participant.php(253): CRM_Core_Transaction->commit()
#24 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/Traits/DAOActionTrait.php(171): CRM_Event_BAO_Participant::create(Array)
#25 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/Traits/DAOActionTrait.php(140): Civi\Api4\Generic\DAOUpdateAction->write(Array)
#26 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/DAOUpdateAction.php(30): Civi\Api4\Generic\DAOUpdateAction->writeObjects(Array)
#27 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractUpdateAction.php(95): Civi\Api4\Generic\DAOUpdateAction->updateRecords(Array)
#28 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(72): Civi\Api4\Generic\AbstractUpdateAction->_run(Object(Civi\Api4\Generic\Result))
#29 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(156): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Generic\DAOUpdateAction))
#30 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(256): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOUpdateAction))
#31 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/api/api.php(91): Civi\Api4\Generic\AbstractAction->execute()
#32 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Api4/Page/AJAX.php(116): civicrm_api4('Participant', 'update', Array, NULL)
#33 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Api4/Page/AJAX.php(55): CRM_Api4_Page_AJAX->execute('Participant', 'update', Array, NULL)
#34 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(322): CRM_Api4_Page_AJAX->run(Array, NULL)
#35 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem(Array)
#36 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke(Array)
#37 /home/[MYDOMAIN]/www/www/wp-content/plugins/civicrm/civicrm.php(1231): CRM_Core_Invoke::invoke(Array)
#38 /home/[MYDOMAIN]/www/www/wp-includes/class-wp-hook.php(324): CiviCRM_For_WordPress->invoke('')
#39 /home/[MYDOMAIN]/www/www/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#40 /home/[MYDOMAIN]/www/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#41 /home/[MYDOMAIN]/www/www/wp-admin/admin.php(259): do_action('toplevel_page_C...')
#42 {main}
  thrown
peth-systopia commented 6 months ago

This has not been reported to us by our customers or other users yet.

jofranz commented 6 months ago

IIRC this has been solved with CiviCRM 5.70+