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.
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
Comment | File | Size | Author |
---|---|---|---|
#1 | wysiwyg_property-drupal-undefined_2414175_1.patch | 1.06 KB | eyilmaz |
Comments
Comment #1
eyilmazhere is a patch
Comment #2
eyilmazMaybe this also has something todo with the Module WYSIWYG_Fields which doesn't support CKEditor 4.
Comment #3
TwoDThere'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.
Comment #4
Kevin O'Halloran CreditAttribution: Kevin O'Halloran commentedI 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.
Comment #5
Kevin O'Halloran CreditAttribution: Kevin O'Halloran commentedInstead 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?
Comment #6
TwoDSee #3, there's no proper fix yet.
Comment #7
TwoDThis will be fixed with #2243413: Error when adding field items - Add another item, please follow that issue instead..