Add event for checkIfEmpty check
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3483462. --> Reported by: [marcus_johansson](https://www.drupal.org/user/385947) Related to !429 !1305 !1131 >>> <p>--- AI TRACKER METADATA ---<br> <strong>Update Summary: </strong>Very easy to fix for Automators.<br> <strong>Check-in Date: </strong>MM/DD/YYYY (US format) [When we should see progress/get an update]<br> <strong>Due Date:</strong> MM/DD/YYYY (US format) [When the issue should be fully completed]<br> <strong>Blocked by:</strong> [#XXXXXX] (New issues on new lines)<br> <strong>Additional Collaborators:</strong> @username1, @username2<br> AI Tracker found here: <a href="https://www.drupalstarforge.ai/" title="AI Tracker">https://www.drupalstarforge.ai/</a><br> --- END METADATA ---</p> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Currently each automator rule decides if the field you are trying to fill out is empty and only runs when its empty.</p> <p>There might be programatical reasons why you want to rerun a specific automator instruction even if its filled out, like other rules that evaluates the response and wants to redo it.</p> <p>Or other use cases not thought of yet.</p> <p>This should be using the <a href="https://www.drupal.org/docs/develop/creating-modules/subscribe-to-and-dispatch-events">https://www.drupal.org/docs/develop/creating-modules/subscribe-to-and-dispatch-events</a> as an event and the event should be triggered after the method have been called on these two places:</p> <p><a href="https://git.drupalcode.org/project/ai/-/blob/1.0.x/modules/ai_automators/src/AiAutomatorEntityModifier.php?ref_type=heads#L261">https://git.drupalcode.org/project/ai/-/blob/1.0.x/modules/ai_automators/src/AiAutomatorEntityModifier.php?ref_type=heads#L261</a><br> <a href="https://git.drupalcode.org/project/ai/-/blob/1.0.x/modules/ai_automators/src/AiAutomatorEntityModifier.php?ref_type=heads#L240">https://git.drupalcode.org/project/ai/-/blob/1.0.x/modules/ai_automators/src/AiAutomatorEntityModifier.php?ref_type=heads#L240</a></p> <p>Alternative a hook_alter could be used.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>* Add an even after the isEmpty check has run where the answer can be modified before its being tested.<br> * Give the whole automatorConfig and the entity as context, so its easy to just trigger the event on a specific automator instruction.</p>
issue