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-&gt;getDerivativeDefinitions() (line 61 of modules/contrib/eca_tool/src/Plugin/tool/Tool/EcaDeriver.php).<br><br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator-&gt;getDerivatives() (Line: 87)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator-&gt;getDefinitions() (Line: 340)<br>Drupal\Core\Plugin\DefaultPluginManager-&gt;findDefinitions() (Line: 216)<br>Drupal\Core\Plugin\DefaultPluginManager-&gt;getDefinitions() (Line: 37)<br>Drupal\eca_tool\Plugin\Action\ToolDeriver-&gt;getDerivativeDefinitions() (Line: 101)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator-&gt;getDerivatives() (Line: 87)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator-&gt;getDefinitions() (Line: 340)<br>Drupal\Core\Plugin\DefaultPluginManager-&gt;findDefinitions() (Line: 216)<br>Drupal\Core\Plugin\DefaultPluginManager-&gt;getDefinitions() (Line: 25)<br>Drupal\Core\Plugin\DefaultPluginManager-&gt;getDefinition() (Line: 16)<br>Drupal\Core\Plugin\Factory\ContainerFactory-&gt;createInstance() (Line: 85)<br>Drupal\Component\Plugin\PluginManagerBase-&gt;createInstance() (Line: 171)<br>Drupal\eca\PluginManager\Action-&gt;createInstance() (Line: 62)<br>Drupal\Core\Plugin\DefaultSingleLazyPluginCollection-&gt;initializePlugin() (Line: 80)<br>Drupal\Component\Plugin\LazyPluginCollection-&gt;get() (Line: 19)<br>Drupal\Core\Action\ActionPluginCollection-&gt;get() (Line: 83)<br>Drupal\Core\Plugin\DefaultSingleLazyPluginCollection-&gt;setConfiguration() (Line: 99)<br>Drupal\Core\Plugin\DefaultSingleLazyPluginCollection-&gt;addInstanceId() (Line: 55)<br>Drupal\Core\Plugin\DefaultSingleLazyPluginCollection-&gt;__construct() (Line: 115)<br>Drupal\system\Entity\Action-&gt;getPluginCollection() (Line: 131)<br>Drupal\system\Entity\Action-&gt;getPlugin() (Line: 146)<br>Drupal\system\Entity\Action-&gt;getPluginDefinition() (Line: 72)<br>Drupal\eca\Plugin\Action\PreConfiguredActionDeriver-&gt;getDerivativeDefinitions() (Line: 101)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator-&gt;getDerivatives() (Line: 87)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator-&gt;getDefinitions() (Line: 340)<br>Drupal\Core\Plugin\DefaultPluginManager-&gt;findDefinitions() (Line: 216)<br>Drupal\Core\Plugin\DefaultPluginManager-&gt;getDefinitions() (Line: 105)<br>Drupal\eca\PluginManager\Action-&gt;getDefinitions() (Line: 61)<br>Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver-&gt;getDerivativeDefinitions() (Line: 101)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator-&gt;getDerivatives() (Line: 87)<br>Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator-&gt;getDefinitions() (Line: 340)<br>Drupal\Core\Plugin\DefaultPluginManager-&gt;findDefinitions() (Line: 33)<br>Drupal\ai\Service\FunctionCalling\FunctionCallPluginManager-&gt;getDefinitions() (Line: 127)<br>Drupal\ai_api_explorer\Plugin\AiApiExplorer\ToolsExplorer-&gt;buildForm() (Line: 60)<br>Drupal\ai_api_explorer\Form\AiApiExplorerForm-&gt;buildForm()<br>call_user_func_array() (Line: 554)<br>Drupal\Core\Form\FormBuilder-&gt;retrieveForm() (Line: 303)<br>Drupal\Core\Form\FormBuilder-&gt;buildForm() (Line: 73)<br>Drupal\Core\Controller\FormController-&gt;getContentResult()<br>call_user_func_array() (Line: 123)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 634)<br>Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()<br>Fiber-&gt;start() (Line: 635)<br>Drupal\Core\Render\Renderer-&gt;executeInRenderContext() (Line: 121)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext() (Line: 97)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 183)<br>Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw() (Line: 76)<br>Symfony\Component\HttpKernel\HttpKernel-&gt;handle() (Line: 53)<br>Drupal\Core\StackMiddleware\Session-&gt;handle() (Line: 48)<br>Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle() (Line: 28)<br>Drupal\Core\StackMiddleware\ContentLength-&gt;handle() (Line: 32)<br>Drupal\big_pipe\StackMiddleware\ContentLength-&gt;handle() (Line: 118)<br>Drupal\page_cache\StackMiddleware\PageCache-&gt;pass() (Line: 92)<br>Drupal\page_cache\StackMiddleware\PageCache-&gt;handle() (Line: 48)<br>Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle() (Line: 51)<br>Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle() (Line: 53)<br>Drupal\Core\StackMiddleware\AjaxPageState-&gt;handle() (Line: 54)<br>Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle() (Line: 745)<br>Drupal\Core\DrupalKernel-&gt;handle() (Line: 19)</pre><p>-mike</p> > Related issue: [Issue #3587110](https://www.drupal.org/node/3587110)
issue