Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Steps to reproduce:
- Set a ckeditor profile with both the 'dndck4' and the 'counter' plugins activated
- Create a new node and insert an image atom via d&d in the editable area
- Uncheck the 'Add a caption' checkbox
- Save the node
- Edit the node again, the editing area won't be usable and there will be some errors output in the console aswell
This only happens if the 'Add a caption' checkbox is unchecked. It may be an issue of the 'count' plugin, I'll investigate later.
Comment | File | Size | Author |
---|---|---|---|
#4 | fix-errors-with-counter-plugin-2401717-4.patch | 763 bytes | nagy.balint |
Comments
Comment #1
nagy.balint CreditAttribution: nagy.balint commentedConfirmed, after enabling "Plugin to count symbols, symbols without blanks and words"
After saving a node, and reopening the edit form, the following errors appear:
---------------
plugin.js?t=EAPE:67:
Uncaught TypeError: Cannot read property 'getHtml' of undefined
CKEDITOR.plugins.add.init.editor.widgets.add.downcast
...
--------------
ckeditor.js?nmeljs:594
Uncaught TypeError: Cannot read property 'getRanges' of null
(anonymous function)
ckeditor.js?nmeljs:630
CKEDITOR.menu.CKEDITOR.tools.createClass._.onShow
...
-----------
Comment #2
nagy.balint CreditAttribution: nagy.balint commentedSo far it seems that this line in ckeditor module
var text = ev.editor.getData();
inside the
function count( ev )
in ckeditor/plugins/counter/plugin.js breaks it, if I comment this single line everything works. (except counting of course).Comment #3
nagy.balint CreditAttribution: nagy.balint commentedSo far i realized that the issue is with the events getData calls:
!internal && this.fire( 'beforeGetData' );
!internal && this.fire( 'getData', eventData );
As if i call it with true parameter (internal)
Then it does not throw any errors (it does not get the proper updated text though)
Comment #4
nagy.balint CreditAttribution: nagy.balint commentedManaged to solve the issue.
It seems that simply when there is no caption, then it does not exist and then this.editables.caption.getHtml() will fail. So an additional check there and all is fine :)
Comment #5
nagy.balint CreditAttribution: nagy.balint commentedCommitted.
Comment #6
nagy.balint CreditAttribution: nagy.balint commented