TypeError in DirectSaveProcessing when using AI Automators with modules that decorate the messenger service
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3540499. --> Reported by: [gge](https://www.drupal.org/user/1317718) Related to !823 >>> <p>Hello,</p> <p>The `DirectSaveProcessing` class in AI Automators module fails with a TypeError when used alongside modules that decorate the core messenger service (such as <a href="https://www.drupal.org/project/eca_helper">ECA Helper</a>). The issue occurs because the class uses strict typing with the concrete `Messenger` class instead of the `MessengerInterface`.</p> <p>Error Message:<br> <code>TypeError: Drupal\ai_automators\Plugin\AiAutomatorProcess\DirectSaveProcessing::__construct(): Argument #3 ($messenger) must be of type Drupal\Core\Messenger\Messenger, Drupal\eca_helper\Decorate\Messenger given, called in /var/www/trasabilitate-deseuri/public_html/web/modules/contrib/ai/modules/ai_automators/src/Plugin/AiAutomatorProcess/DirectSaveProcessing.php on line 58</code></p> <p>Fixed in AI 2.0.x and 1.2.x. For AI 1.1.x users, manual fix available here: <a href="https://git.drupalcode.org/project/ai/-/commit/737440e4e85a7e0cc0c40a91bf2af7dd113886d0">https://git.drupalcode.org/project/ai/-/commit/737440e4e85a7e0cc0c40a91bf2af7dd113886d0</a></p> <p>Thanks!</p>
issue