Problem/Motivation

Iframe element is getting wiped out in WYSIWYG editor after toggling to source code view. This can be observed where embedded content in an iframe has been placed within an accordion.

Steps to reproduce

  1. Also install the ckeditor_iframe module.
  2. Edit a page and place an iframe embedded within a details (accordion).
  3. In the WYSIWYG editor, click on the details summary to open the details accordion.
  4. Switch view to source code. The iframe element will have been changed to an img element with type=iframe

Proposed resolution

In /js/plugins/detail/plugin.js, add another line to the allowedContent beginning at line 39:

                      + 'iframe[longdesc,name,scrolling,src,title,align,height,frameborder,width];'

So that it looks something like this (the sequence of the lines doesn't matter, as far as I know):

                      allowedContent: 'abbr br strong em small span strong sub sup time;'
                        + 'drupal-media[data-entity-type,data-entity-uuid,data-align];'
                        + 'img[!src,alt,width,height,data-entity-type,data-entity-uuid,data-align,data-caption];'
                        + 'iframe[longdesc,name,scrolling,src,title,align,height,frameborder,width];'
                        + 'picture svg video'

We are working on creating a patch file to do this, but it should be a simple change to incorporate to a minor version update.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ryanrobinson_wlu created an issue. See original summary.

ryan-l-robinson’s picture

StatusFileSize
new1.36 KB

First attempt at patch (I don't have much experience with these).

ryan-l-robinson’s picture

StatusFileSize
new684 bytes

Another try at the patch, generated from within a Docker Linux this time instead of Windows.

Unfortunately this one also still won't apply with composer for me but not clear why.

ryan-l-robinson’s picture

StatusFileSize
new684 bytes

Another attempt at the patch.

ryan-l-robinson’s picture

ryan-l-robinson’s picture

Status: Active » Needs review
ryan-l-robinson’s picture

Issue summary: View changes
ryan-l-robinson’s picture

StatusFileSize
new684 bytes

Another patch effort. Sorry for spamming, but I think it might be that it needs to be patch level -p1 instead of -p2? That looks like it will apply that way.

ryan-l-robinson’s picture

ryan-l-robinson’s picture

liam morland’s picture

Version: 2.0.3 » 2.x-dev
Status: Needs review » Needs work
Issue tags: +Needs merge request

ryan-l-robinson’s picture

Status: Needs work » Needs review
Issue tags: -Needs merge request

liam morland’s picture

Version: 2.x-dev » 2.1.x-dev
Status: Needs review » Fixed

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.