Using CKEditor ACF, atoms are spoiled when toggling source view or saving. I have the "Scald Drag and Drop integration - CKEditor 4 widgets" plugin enabled but the button doesn't appear. Even if I add the button to the toolbar manually, it doesn't seem to help.

The instructions advise to "set up correctly (or disabled)" (https://www.drupal.org/node/1775718).

Another solution is to add code to ACF "Extra allowed content" (https://www.drupal.org/node/2237683#comment-10888422)

I found that if I add an allowedConfig property to editor.addCommand('atomProperties') the ACF worked properly.

I'm using Drupal 7.43, Scald 7.x-1.x-dev (2016-Mar-13) , CKEditor 7.x-1.17.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bwaindwain created an issue. See original summary.

bwaindwain’s picture

martin_q’s picture

Status: Active » Needs review

Setting status to "needs review" to trigger the testing bot.

nagy.balint’s picture

Thanks for the patch!

What about the allowedContent: {}, in editor.widgets.add('dndck4', { is that supposed to stay empty? or maybe its enough to add something there?

Also make sure that the same change is used here https://www.drupal.org/node/2664350

So div span figure, and not just div.

nagy.balint’s picture

Here is a new patch with the additional tags.

It seems to work for me after i properly cleared my browser cache.

Since the current version does not work at all if ACF is enabled, any improvement is good.

nagy.balint’s picture

Status: Needs review » Fixed
scotwith1t’s picture

Status: Fixed » Needs work

Sorry to reopen, but this isn't working for us. I have ACF on, DnD into body, save, everything's fine. Edit the node and the scald bits are stripped out of the markup except for the legend (

tag around it). I'm using the latest dev with the patch above...I don't see any of these attributes in the markup at any point in the process (data-scald-sid,data-scald-align,data-scald-context,data-scald-options,data-scald-type). What might be wrong?

Markup when I DnD inside the CKEditor window looks like this:

<div tabindex="-1" contenteditable="false" data-cke-widget-wrapper="1" data-cke-filter="off" class="cke_widget_wrapper cke_widget_block cke_widget_selected" data-cke-display-name="atom" data-cke-widget-id="1"><div class="cke_widget_element dnd-widget-wrapper context-full_width type-image" data-cke-widget-keep-attr="0" data-widget="dndck4" data-cke-widget-data="%7B%22sid%22%3A%22274%22%2C%22type%22%3A%22image%22%2C%22context%22%3A%22full_width%22%2C%22options%22%3A%22%7B%7D%22%2C%22align%22%3A%22none%22%2C%22usesCaption%22%3A1%2C%22classes%22%3A%7B%22dnd-atom-wrapper%22%3A1%7D%7D"><div class="dnd-atom-rendered"><!-- scald=274:full_width --><img src="http://mysite.com/sites/default/files/styles/full_width/public/thumbnails/image/region_pacific.png?itok=ORvdpPtA" width="1180" height="1291" alt="G" title="G"><!-- END scald=274 --></div><div class="dnd-caption-wrapper cke_widget_editable" contenteditable="true" data-cke-widget-editable="caption" data-cke-enter-mode="2" data-cke-filter="54" data-cke-display-name="caption"></div></div><span class="cke_reset cke_widget_drag_handler_container" style="top: -15px; left: 0px; background: url(&quot;//cdn.ckeditor.com/4.4.3/full-all/plugins/widget/images/handle.png&quot;) rgba(220, 220, 220, 0.498039);"><img class="cke_reset cke_widget_drag_handler" data-cke-widget-drag-handler="1" src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" width="15" title="Click and drag to move" height="15"></span></div>

When it's saved, it looks like this in the node page:

<div class="dnd-widget-wrapper context-full_width type-image"><div class="dnd-atom-rendered"><!-- scald=274:full_width --><img class="img-responsive" src="http://mysite.com/sites/default/files/styles/full_width/public/thumbnails/image/region_pacific.png?itok=ORvdpPtA" width="1180" height="1291" alt="G" title="G"><!-- END scald=274 --></div></div>

Then I try to edit, all I'm left with in CKEditor is:

<p><br></p>
nagy.balint’s picture

Make sure that your browser cache is completely cleared by opening the console while using the page for example.

Since for me it worked fine, I will likely need access to a test site having this issue.

nagy.balint’s picture

Also make sure that the edit atom properties button is added in ckeditor configuration, since this patch will only work if that button is there.

scotwith1t’s picture

YES! Don't know which did it, but it worked. The atom properties button was missing from 1.6, is this something that has been added back to the latest dev? Are we close to a 1.7 release? Thanks as always!

scotwith1t’s picture

Status: Needs work » Closed (fixed)
bwaindwain’s picture