WYSIWYG 'Add Image' feature breaks when you use the asset selector helper
PermalinkIf you're building a custom form, and you put an asset selector on the page, and the page also has a field that has WYSIWYG capabilities, the WYSIWYG 'Add Image' button actually adds the image to the asset selector field, instead of to the WYSIWYG field.
I was hoping there might be a fix for this out there...
In our own javascript (outside the Concrete source code), I put the following:
$("div.ccm-editor-controls-right-cap ul li:first a").click(function(){ ccm_chooseAsset = function(obj) { var mceEd = tinyMCE.activeEditor; mceEd.selection.moveToBookmark(bm); // reset selection to the bookmark (ie looses it) switch(ccm_editorCurrentAuxTool) { case "image": var args = {}; tinymce.extend(args, { src : obj.filePathInline, alt : obj.title, width : obj.width, height : obj.height }); mceEd.execCommand('mceInsertContent', false, '<img id="__mce_tmp" src="javascript:;" />', {skip_undo : 1}); mceEd.dom.setAttribs('__mce_tmp', args);
Note that it does the same thing for the sitemap selector as well.
http://www.concrete5.org/developers/bugs/5-4-1-1/block-with-tinymce...
I'm going to try the upgrade to 5.4.2 to see if it fixes it.