Modify with a Prompt plugin is unable save the generated output to editor
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3523520. --> Reported by: [annmarysruthy](https://www.drupal.org/user/3664314) Related to !589 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The "Modify with a prompt" plugin in the ai_ckeditor module is designed to apply AI-generated modifications to selected text in the CKEditor. However, after generating a result and clicking "Save changes to editor", the originally selected text disappears instead of being replaced with the modified content. This disrupts user expectations and results in data loss within the editor.</p> <p>This issue impacts the usability of the plugin and defeats its core purpose&mdash;modifying selected text via custom instructions.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Open a CKEditor field in a content</li> <li>Select any portion of text.</li> <li>Click the "Modify with a prompt" plugin under AI Assistant.</li> <li>In the modal:Add custom instructions in the "Your instructions" field.</li> <li>Click on generate</li> <li>Once the result is displayed in the "Result" field, click "Save changes to editor".</li> <li>Observe that the original selected text disappears, and no replacement is inserted.</li> </ol> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3>
issue