Using this module with latest ckeditor and field_collection
when I click "Add another item" the form breaks and the following Error appears:
Uncaught TypeError: Cannot read property 'drupal' of undefined ckeditor-3.0.js:111

Solution:
Adding if (Drupal.settings.wysiwyg.plugins.length) {}
around the for-loop solves the problem.

Greetz
eyilmaz

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eyilmaz’s picture

here is a patch

eyilmaz’s picture

Priority: Normal » Minor

Maybe this also has something todo with the Module WYSIWYG_Fields which doesn't support CKEditor 4.

TwoD’s picture

There's a known problem with how settings are passed into the editor implementation, though I don't remember the name of the issue where that was discovered. Much work has been done to better handle the settings for AJAXy situations in the module core, but it needs to happen in the wysiwyg/editors/js/editorname*.js files as well.

The patch here fixes the error by not attempting to access the list of plugins when it's empty, but the real problem is that the list is empty in the first place. This can happen when using multiple editor profiles (different text formats) and they're not using the same plugins, after an AJAX operation only included settings for the formats used in the specific field(s) which were reloaded.

Kevin O'Halloran’s picture

I am experiencing a similar error using the latest WYSIWYG and Media modules, with CKEditor.

If I click on the "add media" button from the CKEditor toolbar, I get this javascript error:

"Uncaught TypeError: Cannot read property 'Drupal' of undefined".

I traced it to this line in the media.popup.js file:

var selected = this.contentWindow.Drupal.media.browser.selectedMedia

the problem is happening both in Chrome and FireFox.

I am also looking at the Media module queue and will update/add something there.

update:
https://www.drupal.org/node/596966 shows the max supported version of CKEditor as 3.6.6.2, and I am running CKEditor 4.
Will have to downgrade the editor and try again.

Kevin O'Halloran’s picture

Instead of downgrading to the earlier version of ckeditor, i upgraded to the 7.x-2.x-dev version of WYSIWYG, which supports the latest ckeditor. For a time, this fixed the problem. But with my latest dev install, it is happening again. Any one else having this issue?

TwoD’s picture

See #3, there's no proper fix yet.

TwoD’s picture

Status: Active » Closed (duplicate)
Related issues: +#2243413: Error when adding field items - Add another item

This will be fixed with #2243413: Error when adding field items - Add another item, please follow that issue instead..