What I have is a single field that is an image field that contains a textarea using wysiwyg/ckeditor. This field is created by a custom module and could easily be the culprit however im at a point where i am a little stumped. The module just re implements the image and text modules widget functions into a single field instance.
When selecting an image and then clicking upload the editor goes away and I receive the following error message.
Uncaught [CKEDITOR.editor] The instance "edit-field-banner-image-und-0-value-value" already exists
It's my understanding that this is most likely happening because Drupal.wysiwyg[instance].detach() is not being called before ckeditor wants to create the new instance of the editor. I attempted to implement this in my custom module, but the way drupal handles ajax the click() event doesnt seem to bubble up to a point that I can attach to it. Is it possible this should be happening at a different level then where I am implementing this?
Comments
Comment #1
twodI think that uploading an image triggers a background reload of the field elements, which Wysiwyg isn't notified of so it doesn't detach the editor properly before the new elements - with a new editor instance - are created.
I was hoping issues like this got fixed when #1155678: Implement Drupal.behaviors.attachWysiwyg.detach went in.
Could you check with the -dev version and perhaps the patch from #356480: Lazy-load editors? I'm not sure that patch is relevant to the issue, but that depends a bit on how the custom fields were implemented.
Comment #2
twodComment #3
twodWithout further details about the problem I can only close this issue. Please re-open it if you can provide the requested information.