Drupal CKEditor image2 plugin only works after rebooting wyiwyg

I am using CKEditor with environment 2 and image2. When I insert an image with the medium, the markup

<p><mediawrapper data=""><img alt="" class="file-default media-element" data-fid="3" data-media-element="1" height="960" src="/sites/default/files/banner_images/image.JPG" typeof="foaf:Image" width="1280" /></mediawrapper></p> 

If I select an image and try to use image2, it will not get the URL of the image.

If I then click "Source" and then "Source" again to return to wysiwyg mode, I can select an image, and image2 selects it perfectly.

Then the markup is as follows:

 <p><img alt="" src="/sites/default/files/banner_images/image.JPG" /></p> 

I tried calling updateElement () after inserting a media image, but without success. I used:

 for ( instance in CKEDITOR.instances ){ CKEDITOR.instances[instance].updateElement(); } 

Does anyone know how to fix this?

+5
source share
2 answers

The markup on StackOverflow is broken, so you cannot see your samples.

But the problem you are describing is very similar to the default interleaving behavior of CKEditor. CKEditor ACL filters remove all unknown (or restricted) tags from the content area. To fix this problem, you need to add this line to your config.js (in the case of using Drupal in a text box in the admin panel):

 config.allowedContent = true; 
0
source

I found a solution on drupal.org, here: https://www.drupal.org/node/2400455#comment-11135553

0
source

Source: https://habr.com/ru/post/1233190/


All Articles