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.
Hi,
this error stops ckeditor and throw error in firebug console after clicking any CKeditor button
TypeError: tagCache[tag_id] is undefined
var tag = tagCache[tag_id].tag;
on line 1030 col 23
I have installed latest CKEditor 7.x-1.17 and Asset 7.x-1.0-beta4+52-dev
I think its related to Assets in wysiwyg isn't added to js cache on page load
I needed really fast solution then i used this patch #8 (thanks eugene.ilyin ) and override (like "be silent please..") at last condition (row 1037) in file asset/ckeditor/plugin.js, from:
if (element.attributes && element.attributes['data-asset-cid']) {
var tag_id = element.attributes['data-asset-cid'];
var tag = tagCache[tag_id].tag;
tag = tag.replace(/</g, '<');
tag = tag.replace(/>/g, '>');
var tagEl = new CKEDITOR.htmlParser.fragment.fromHtml(tag);
return tagEl.children[0];
}
return element;
to
if (element.attributes && element.attributes['data-asset-cid']) {
var tag_id = element.attributes['data-asset-cid'];
if (typeof(tagCache[tag_id]) == 'undefined') {
// nothing to do
} else {
var tag = tagCache[tag_id].tag;
tag = tag.replace(/</g, '<');
tag = tag.replace(/>/g, '>');
var tagEl = new CKEDITOR.htmlParser.fragment.fromHtml(tag);
return tagEl.children[0];
}
}
return element;
Thanks for advice
Comments