Array type issue when rebuilding caches
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3586488. -->
Reported by: [ultimike](https://www.drupal.org/user/51132)
Related to !1
>>>
<p>I created a very simple ECA module with the tool event, when I attempted to rebuild caches, I received the error:</p>
<p>The website encountered an unexpected error. Try again later.</p>
<pre>Error: Cannot use object of type Drupal\tool\Tool\ToolDefinition as array in Drupal\eca_tool\Plugin\tool\Tool\EcaDeriver->getDerivativeDefinitions() (line 61 of modules/contrib/eca_tool/src/Plugin/tool/Tool/EcaDeriver.php).<br><br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives() (Line: 87)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 340)<br>Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 216)<br>Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 37)<br>Drupal\eca_tool\Plugin\Action\ToolDeriver->getDerivativeDefinitions() (Line: 101)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives() (Line: 87)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 340)<br>Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 216)<br>Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 25)<br>Drupal\Core\Plugin\DefaultPluginManager->getDefinition() (Line: 16)<br>Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 85)<br>Drupal\Component\Plugin\PluginManagerBase->createInstance() (Line: 171)<br>Drupal\eca\PluginManager\Action->createInstance() (Line: 62)<br>Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->initializePlugin() (Line: 80)<br>Drupal\Component\Plugin\LazyPluginCollection->get() (Line: 19)<br>Drupal\Core\Action\ActionPluginCollection->get() (Line: 83)<br>Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->setConfiguration() (Line: 99)<br>Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->addInstanceId() (Line: 55)<br>Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->__construct() (Line: 115)<br>Drupal\system\Entity\Action->getPluginCollection() (Line: 131)<br>Drupal\system\Entity\Action->getPlugin() (Line: 146)<br>Drupal\system\Entity\Action->getPluginDefinition() (Line: 72)<br>Drupal\eca\Plugin\Action\PreConfiguredActionDeriver->getDerivativeDefinitions() (Line: 101)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives() (Line: 87)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 340)<br>Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 216)<br>Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 105)<br>Drupal\eca\PluginManager\Action->getDefinitions() (Line: 61)<br>Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver->getDerivativeDefinitions() (Line: 101)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives() (Line: 87)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 340)<br>Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 33)<br>Drupal\ai\Service\FunctionCalling\FunctionCallPluginManager->getDefinitions() (Line: 127)<br>Drupal\ai_api_explorer\Plugin\AiApiExplorer\ToolsExplorer->buildForm() (Line: 60)<br>Drupal\ai_api_explorer\Form\AiApiExplorerForm->buildForm()<br>call_user_func_array() (Line: 554)<br>Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 303)<br>Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)<br>Drupal\Core\Controller\FormController->getContentResult()<br>call_user_func_array() (Line: 123)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 634)<br>Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()<br>Fiber->start() (Line: 635)<br>Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)<br>Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)<br>Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)<br>Drupal\Core\StackMiddleware\Session->handle() (Line: 48)<br>Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)<br>Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)<br>Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 118)<br>Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 92)<br>Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)<br>Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)<br>Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53)<br>Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 54)<br>Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 745)<br>Drupal\Core\DrupalKernel->handle() (Line: 19)</pre><p>-mike</p>
> Related issue: [Issue #3587110](https://www.drupal.org/node/3587110)
issue