PHP Fatal errors in AI Automators

Created on 22 November 2024, about 1 month ago

Problem/Motivation

Attempting to use the AI Automators module in the latest dev causes a fatal error.

Steps to reproduce

The website encountered an unexpected error. Try again later.

Error: Call to undefined method Drupal\ai_automators\Rulehelpers\GeneralHelper::getTextFormat() in Drupal\ai_automators\PluginBaseClasses\EntityReference->storeValues() (line 289 of modules/contrib/ai/modules/ai_automators/src/PluginBaseClasses/EntityReference.php).
Drupal\ai_automators\AiAutomatorRuleRunner->generateResponse() (Line: 70)
Drupal\ai_automators\Plugin\AiAutomatorProcess\DirectSaveProcessing->modify() (Line: 229)
Drupal\ai_automators\AiAutomatorEntityModifier->markFieldForProcessing() (Line: 129)
Drupal\ai_automators\AiAutomatorEntityModifier->saveEntity() (Line: 31)
ai_automators_entity_presave()
call_user_func_array() (Line: 416)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 395)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 415)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 217)
Drupal\Core\Entity\EntityStorageBase->invokeHook() (Line: 900)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook() (Line: 529)
Drupal\Core\Entity\EntityStorageBase->doPreSave() (Line: 753)
Drupal\Core\Entity\ContentEntityStorageBase->doPreSave() (Line: 483)
Drupal\Core\Entity\EntityStorageBase->save() (Line: 806)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (Line: 354)
Drupal\Core\Entity\EntityBase->save() (Line: 277)
Drupal\node\NodeForm->save()
call_user_func_array() (Line: 129)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 67)
Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 597)
Drupal\Core\Form\FormBuilder->processForm() (Line: 144)
Drupal\autosave_form\Form\AutosaveFormBuilder->processForm() (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 97)
Drupal\autosave_form\Form\AutosaveFormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Proposed resolution

Replace method call with code that does what it appears to require - getting a text format for a text format field.

🐛 Bug report
Status

Active

Version

1.0

Component

AI Automators

Created by

🇬🇧United Kingdom MrDaleSmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024