Created
April 13, 2026 16:59
-
-
Save junaidpv/469b1874670d877604117b99b3c8c2f8 to your computer and use it in GitHub Desktop.
Fix "Uncaught TypeError: can't access property "querySelector", document.querySelector(...) is null" in editor config page on clicking on Add Group button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/js/ckeditor.admin.js b/js/ckeditor.admin.js | |
| index a1a0d1a..0dc97a6 100644 | |
| --- a/js/ckeditor.admin.js | |
| +++ b/js/ckeditor.admin.js | |
| @@ -191,7 +191,10 @@ | |
| } | |
| }); | |
| dialog.showModal(); | |
| - $(document.querySelector('.ckeditor-name-toolbar-group').querySelector('input')).attr('value', $group.attr('data-drupal-ckeditor-toolbar-group-name')).trigger('focus'); | |
| + let group = document.querySelector('.ckeditor-name-toolbar-group'); | |
| + if (group) { | |
| + $(group.querySelector('input')).attr('value', $group.attr('data-drupal-ckeditor-toolbar-group-name')).trigger('focus'); | |
| + } | |
| } | |
| }; | |
| Drupal.behaviors.ckeditorAdminButtonPluginSettings = { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment