In version 2.22, critical error when using delay for sending messages
Situation:
CiviRules is configured to assign a new user to a group and send a welcome e-mail, after a new membership is created. The e-mail is configured to be sent with a delay of 2 minutes.
Previously, this worked without any problems. Since upgrading to 2.22, a critical error occurs:
Notice: Undefined index: id in /home/staging/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/Civirules/Engine.php on line 28
Fatal error: Uncaught Error: Call to undefined method CRM_Utils_Time::date() in /home/staging/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/Civirules/Engine.php:195 Stack trace: # 0 /home/staging/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/Civirules/Engine.php(79): CRM_Civirules_Engine::delayAction(Object(DateTime), Object(CRM_Civirules_ActionEngine_RuleActionEngine)) # 1 /home/staging/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/Civirules/Engine.php(61): CRM_Civirules_Engine::executeAction(Object(CRM_Civirules_TriggerData_Post), Array) # 2 /home/staging/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/Civirules/Engine.php(36): CRM_Civirules_Engine::executeActions(Object(CRM_Civirules_TriggerData_Post)) # 3 /home/staging/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/CivirulesPostTrigger/GroupContact.php(58): CRM_Civirules_Engine::triggerRule(Object(CRM_CivirulesPostTrigger_GroupContact), Object(CRM_Civirules in /home/staging/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/Civirules/Engine.php on line 195
System setup:
CiviCRM 5.32.2 under Wordpress 5.6.2, CiviRules 2.22, some other extensions which are probably not related to this error, PHP 7.3
Analysis so far:
The reference to CRM_Utils_Time::date() in the error message led me to trying to disable the delay for sending the e-mail, which seems to be the only date/time related bit in the configuration. And indeed, if I send the e-mail immediately and without any programmatic delay, no error occurs.