saveCallback overwritten — causes "has is not a function" error in CKEditor 5
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3542922. -->
Reported by: [himanshu5050](https://www.drupal.org/user/2703471)
Related to !848
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The module uses Drupal.ckeditor5.saveCallback = saveCallback, overwriting the default Map object. This results in a TypeError when .has() is called elsewhere.</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>Enable and configure AI ckeditor module.<br>
Open dialog box for AI assistant.<br>
Try close dialog box.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Replace:<br>
Drupal.ckeditor5.saveCallback = saveCallback;</p>
<p>With:<br>
Drupal.ckeditor5.saveCallback.set(dialogSettings.selector || '#drupal-modal', saveCallback);</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>
> Related issue: [Issue #2741877](https://www.drupal.org/node/2741877)
issue