AI CKEditor: Hardcoded “summarize” message shown for all plugins when no text is selected
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3575346. --> Reported by: [annmarysruthy](https://www.drupal.org/user/3664314) Related to !1240 >>> <p>[Tracker]<br> <strong>Update Summary: </strong>[One-line status update for stakeholders]<br> <strong>Short Description: </strong> All AI CKEditor plugins display "You must select some text before you can summarize it" even when the active plugin is Translate, Tone, or SpellFix.[One-line issue summary for stakeholders]<br> <strong>Check-in Date: </strong>02/24/2026<br> <em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br> [/Tracker]</p> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Most AI CKEditor plugins (e.g., Translate, Tone, SpellFix, etc.) require selected text in order to operate.</p> <p>If no text is selected, a validation message is displayed. However, the message is currently hardcoded in <code>AiCKEditorPluginBase.php</code> and reads:</p> <p>"You must select some text before you can summarize it."</p> <p>This message is shown for all plugins, including:</p> <p>- Translate<br> - Tone<br> - SpellFix<br> - Others extending <code>AiCKEditorPluginBase</code></p> <p>This results in incorrect and confusing UX. For example:</p> <p>- The Translate plugin should display:<br> "You must select some text before you can translate it."<br> - The Tone plugin should display:<br> "You must select some text before you can alter its tone."<br> - SpellFix should display:<br> "You must select some text before you can fix spelling."</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> <p>1. Enable the following modules:<br> - AI (core)<br> - AI CKEditor (submodule)<br> 2. Configure any AI provider (e.g., OpenAI, Anthropic, etc.).<br> 3. Add an AI CKEditor plugin (e.g., Translate) to a text format toolbar.<br> 4. Open a node edit form using that text format.<br> 5. Click the AI plugin button without selecting any text.</p> <p><strong>Result:</strong><br> The message displayed is:<br> "You must select some text before you can summarize it."</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>The message should reference the correct plugin action (e.g., translate, alter tone, fix spelling).</p> <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> <p>NA</p>
issue