No Code Attached Yet bug
avatar Scrabble96
Scrabble96
2 May 2022

Steps to reproduce the issue

  • Create an article custom field of type Editor
  • Select 'Safe HTML' from the Filter options at the bottom of the General tab and save the new field
  • If using TinyMCE, ensure 'iframe' is removed from the list of prohibited elements in the plugin settings
    or if using JCE Editor ensure that all iframes are allowed in the profiles editor under Plugin parameters > Media support
  • Open an article that uses that field and select the field
  • Switch to the Code editor and paste in some html, e.g. <p><iframe src="https://www.google.com/maps/embed?pb=[google-maps-link]" width="600" height="400" style="border: 0;" loading="lazy" allowfullscreen="allowfullscreen" frameborder="0"></iframe></p>

Switch back to the WYSIWYG editor
Save the document

Expected result

The map is saved and visible

Actual result

TinyMCE:
Switching from Code to Editor shows just a blank box, then even before saving the article the code is reduced to
<p><iframe></iframe></p>

JCE Editor:
The map is visible in the Editor pane prior to saving the article, after which the code is stripped out entirely

System information (as much as possible)

J4.1.2

Additional comments

It does the same with the 'RAW html' setting

avatar Scrabble96 Scrabble96 - open - 2 May 2022
avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 May 2022
avatar Scrabble96 Scrabble96 - change - 2 May 2022
The description was changed
avatar Scrabble96 Scrabble96 - edited - 2 May 2022
avatar brianteeman
brianteeman - comment - 2 May 2022

This is the intended and expected behaviour

Look at the tinymce plugin and you will see that by default it prevents iframes

image

Either change the behaviour here in the tinymce editor plugin OR what I do is to change tinymce to use the Joomla Text Filters in the global config so I am only managing them in one place.

avatar Scrabble96
Scrabble96 - comment - 2 May 2022

In my original post, you will see that I said "If using TinyMCE, ensure 'iframe' is removed from the list of prohibited elements in the plugin settings" which is what I did.

Switching to Joomla text filters makes no difference as super users have no filtering applied.

avatar Scrabble96
Scrabble96 - comment - 2 May 2022

I have since discovered that TinyMCE (but not JCE) is stripping all tags except for the first and last, e.g:
<p>This is some text</p>
<p>This is some more text</p>
becomes:
<p>This is some textThis is some more text</p>

avatar Scrabble96
Scrabble96 - comment - 2 May 2022

UPDATE: this is very odd, as switching to Joomla text filters is now working as it should, but it still doesn't explain why it doesn't work the other way. New users to J4 wouldn't have a clue as there are no hints to what "Use Joomla Text Filter" means.

avatar Quy
Quy - comment - 2 May 2022

Maybe related #31540?

avatar chmst chmst - change - 17 Feb 2023
Labels Added: bug
avatar chmst chmst - labeled - 17 Feb 2023

Add a Comment

Login with GitHub to post a comment