TextLongCrawler class does not match the method signature defined in the AiInterpolatorFieldRule interface.

Created on 31 October 2023, 8 months ago

Problem/Motivation

With the module enabled, adding new formatted text fields to an entity results in a WSOD.

The apache2 error log offers some debug info:

PHP Fatal error: Declaration of Drupal\\ai_interpolator_simple_crawler\\Plugin\\AiInterPolatorFieldRules\\TextLongCrawler::generate(string $prompt, Drupal\\Core\\Entity\\ContentEntityInterface $entity, Drupal\\Core\\Field\\FieldDefinitionInterface $fieldDefinition, array $interpolatorConfig) must be compatible with Drupal\\ai_interpolator\\Annotation\\AiInterpolatorFieldRule::generate(Drupal\\Core\\Entity\\ContentEntityInterface $entity, Drupal\\Core\\Field\\FieldDefinitionInterface $fieldDefinition, array $interpolatorConfig) in /var/www/XXX/modules/contrib/ai_interpolator_simple_crawler/src/Plugin/AiInterpolatorFieldRules/TextLongCrawler.php on line 116

Steps to reproduce

  1. Install the module
  2. Add a long, formatted text field to a taxonomy term (not tested on other entities)
  3. A WSOD will occur during the process. The field is created but another WSOD occurs when trying to edit it. Existing fields are seemingly not affected.

Proposed resolution

Make sure that the types and order of parameters match the ones defined in the AiInterpolatorFieldRule interface.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΉπŸ‡­Thailand AlfTheCat

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

Comments & Activities

  • Issue created by @AlfTheCat
  • Assigned to Marcus_Johansson
  • πŸ‡©πŸ‡ͺGermany Marcus_Johansson

    @AlfTheCat Could you double check if you are running alpha2? It should have enabled this interface and also require the latest interpolator module.

    I guess I have released the alpha release to early since I still do have some breaking changes in the base modules (and maybe some to come). The idea of always have a prompt was a stupid from me, since a lot of plugins like this one will not need one.

  • Status changed to Closed: outdated 8 months ago
  • πŸ‡ΉπŸ‡­Thailand AlfTheCat

    Hi Marcus, sorry about that, I was somehow sure I had the latest version but I didn't, I'll update to alpha2 and revisit.

    Loving the interpolator modules so far!

Production build 0.69.0 2024