Dependency on ai_automator

Created on 17 November 2024, 2 months ago

Problem/Motivation

Hi Marcus,

I just tried installing this module but it seems to depend on ai_automator and not ai_automators.

vendor/bin/drush en media_pixabay ai_automator_pixabay
The following module(s) will be installed: media_pixabay, ai_automator_pixabay, entity_browser, ai_automator

Thanks as always :)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

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
  • 🇱🇻Latvia biguzis

    Patch that fix dependency name

  • 🇹🇭Thailand AlfTheCat

    Hi @biguzis,

    Thanks for the patch. I applied it, but now when I set an image field to use the Pixabay automator, the site immediately crashes and new image fields can no longer be added or have their config page accessed.

    Here is the error message printed in the browser:

    The website encountered an unexpected error. Try again later.

    Error: Cannot use object of type Drupal\Core\Form\FormState as array in Drupal\ai_automator_pixabay\Plugin\AiAutomatorType\PixabayImage->extraFormFields() (line 130 of modules/contrib/ai_automator_pixabay/src/Plugin/AiAutomatorType/PixaBayImage.php).

    Drupal\ai_automators\FormAlter\AiAutomatorFieldConfig->alterForm() (Line: 16)
    ai_automators_form_field_config_edit_form_alter() (Line: 552)
    Drupal\Core\Extension\ModuleHandler->alter() (Line: 834)
    Drupal\Core\Form\FormBuilder->prepareForm() (Line: 285)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 48)
    Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 62)
    Drupal\field_ui\Controller\FieldConfigAddController->fieldConfigAddConfigureForm()
    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: 50)
    Drupal\ban\BanMiddleware->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)

    I'm noticing a mix of ai_aitomators and ai_automator in the stacktrace.

    Hope this helps :)

  • 🇩🇪Germany marcus_johansson

    Hi both, biguzis solution is the correct to the initial problem, it had some other problems as well though. I have fixed those as well, please try.

    As part of this bug I also found this bug, so doulbe find :) https://www.drupal.org/project/ai/issues/3489338#comment-15870080 🐛 generateMediaImageFromFile doesn't prepare the directory Active

    Its testable on the dev branch/release.

  • 🇩🇪Germany marcus_johansson

    You will need to update AI module to dev release as well to test this.

  • 🇹🇭Thailand AlfTheCat

    Brilliant, thanks to you both for fixing this double jeopardy issue. It's working great now.

Production build 0.71.5 2024