- Issue created by @ORION web
- Merge request !92Resolve #3450380 "Misspelled property triggers" β (Open) created by Unnamed author
- Issue was unassigned.
- Status changed to Needs review
29 days ago 1:45pm 28 May 2024
I've been testing some ECA models using the openai_eca sub-module and, every time I use the OpenAI/ChatGPT Chat template for my model, I see lots of PHP errors like the following in the logs:
Error: Call to a member function getTokenData() on null in Drupal\openai_eca\Plugin\Action\Chat->execute() (line 102 of /var/www/html/web/modules/contrib/openai/modules/openai_eca/src/Plugin/Action/Chat.php)
These errors are accompanied by the following PHP warning:
Warning: Undefined property: Drupal\openai_eca\Plugin\Action\Chat::$tokenServices in Drupal\openai_eca\Plugin\Action\Chat->execute() (line 102 of /var/www/html/web/modules/contrib/openai/modules/openai_eca/src/Plugin/Action/Chat.php)
I've found that the $tokenServices property used in openai_eca module's Action Plugins doesn't exist, whereas $tokenService can be found in the base class \Drupal\eca\Plugin\Action\ActionBase all these plugins extend from.
Enable the openai_eca sub-module and add an ECA flow with any chatGPT action from the list:
When the ECA model runs and the chatGPT action is triggered, the errors mentioned above occur.
Replacing tokenServices with tokenService seems to resolve the issue.
Needs review
1.0
Code