Add AI Automator field form breaks if fields not available in any bundle
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3558728. --> Reported by: [anmolgoyal74](https://www.drupal.org/user/3560428) Related to !1102 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>If a user tries to add an AI automator field, and for any entity and bundle, if fields are not present, then on submission, the site breaks.<br> This is the error message in the logs</p> <pre>Error: Typed property Drupal\ai_automators\Entity\AiAutomator::$field_name must not be accessed before initialization in Drupal\ai_automators\Entity\AiAutomator-&gt;calculateDependencies() (line 125 of /ai/modules/ai_automators/src/Entity/AiAutomator.php).</pre><p><img src="https://www.drupal.org/files/issues/2025-11-19/Screenshot%202025-11-19%20at%205.20.26%E2%80%AFPM.png" alt="screenshot of the form"></p> <h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4> <p>Please provide information like AI modules enabled, which AI provider, browser, etc.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3> > Related issue: [Issue #3180011](https://www.drupal.org/node/3180011)
issue