Steps to reproduce:

  1. Set a ckeditor profile with both the 'dndck4' and the 'counter' plugins activated
  2. Create a new node and insert an image atom via d&d in the editable area
  3. Uncheck the 'Add a caption' checkbox
  4. Save the node
  5. 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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nagy.balint’s picture

Confirmed, 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
...
-----------

nagy.balint’s picture

So 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).

nagy.balint’s picture

So 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)

nagy.balint’s picture

Status: Active » Needs review
FileSize
763 bytes

Managed 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 :)

nagy.balint’s picture

Status: Needs review » Patch (to be ported)

Committed.

nagy.balint’s picture

Status: Patch (to be ported) » Fixed

  • nagy.balint committed a755e5a on 7.x-1.x
    Issue #2401717 by nagy.balint: CKEditor renders the editable area...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.