No Code Attached Yet
avatar toby07801
toby07801
11 Oct 2023

Steps to reproduce the issue

  • Set Joomla Super User Text Filtering to "No Filtering"
  • Set TinyMCE Plugin setting "Use Joomla Text Filter" to "On"

OR

  • Set Joomla Super User Text Filtering to "No Filtering"
  • Set TinyMCE Plugin setting "Use Joomla Text Filter" to "Off"
  • Enter "empty" under "Prohibited Elements" and *[*] under "Valid Elements", to allow any elements and all attributes as per TinyMCE Documentation

THEN

Open a new Joomla Article, switch to TinyMCE code view and paste in some custom html with custom element attributes such as this sample code:

<div class="el-item">
<a class="uk-box-shadow-small uk-box-shadow-hover-medium tm-box-decoration-secondary uk-inline uk-link-toggle" href="/images/TSLA_W.jpg" data-type="image" data-caption="<h4 class='uk-margin-remove'>Figure 1</h4>" role="button">    
<div class="uk-inline-clip">        
<picture><img src="/templates/cache/f4/TSLA.jpeg" width="3836" height="2025" alt="" loading="lazy" class="el-image uk-transition-opaque"></picture>
<div class="uk-position-bottom-left uk-overlay-default"><div class="uk-overlay uk-padding-small uk-margin-remove-first-child"><h5 class="el-title uk-h5 uk-margin-top uk-margin-remove-bottom"><span class="uk-link-heading">Figure 1</span></h5></div>
</div>
</div>
</a>
</div>

Expected result

Page is saved correctly and code remains unchanged since I have disabled Joomla Filtering in Global Settings for the Super Users group which I am part of, and since I am using either the Joomla Filtering mode (None) option in TinyMCE, or attempting to use its own settings by overriding the TinyMCE native filters and allowing all elements by using the wildcard *[*] in order to prevent it from filtering any potentially disallowed elements or attributes.

Actual result

On save of the article, or by toggling between code view and WYSIWYG mode, then back to code view, the resulting code is heavily stripped back as shown below, and the html no longer functions or renders as intended.

<div class="el-item">
<div class="uk-inline-clip"><picture><img src="templates/cache/f4/TSLA.jpeg" width="3836" height="2025" alt="" loading="lazy" class="el-image uk-transition-opaque" /></picture>
<div class="uk-position-bottom-left uk-overlay-default">
<div class="uk-overlay uk-padding-small uk-margin-remove-first-child">
<h5 class="el-title uk-h5 uk-margin-top uk-margin-remove-bottom"><span class="uk-link-heading">Figure 1</span></h5>
</div>
</div>
</div>
</div>

System information (as much as possible)

PHP Built On Linux 5.15.0-86-generic #96-Ubuntu SMP Wed Sep 20 08:23:49 UTC 2023 x86_64
Database Type mysql
Database Version 10.6.12-MariaDB-0ubuntu0.22.04.1
Database Collation utf8mb3_general_ci
Database Connection Collation utf8mb4_general_ci
Database Connection Encryption None
Database Server Supports Connection Encryption No
PHP Version 8.2.11
Web Server Apache
WebServer to PHP Interface fpm-fcgi
Joomla! Version Joomla! 4.3.4 Stable [ Bora ] 22-August-2023 16:00 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36

Additional comments

A previous post (Issue #35535) has a very similar problem description and I looked at this in detail, but the solution there was that the changes were simply being applied to the wrong "TinyMCE Set", which is definitely not where I have been going wrong and I double and triple check this.

avatar toby07801 toby07801 - open - 11 Oct 2023
avatar toby07801 toby07801 - change - 11 Oct 2023
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 11 Oct 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Oct 2023
avatar toby07801 toby07801 - change - 11 Oct 2023
Title
Issue with TinyMCE Text FIltering Being Ignore
Issue with TinyMCE Text Filtering Being Ignored
avatar toby07801 toby07801 - edited - 11 Oct 2023
avatar toby07801 toby07801 - change - 11 Oct 2023
Title
Issue with TinyMCE Text Filtering Being Ignored
Global Joomla Text Filtering Setting Being Ignored by TinyMCE
avatar toby07801 toby07801 - edited - 11 Oct 2023
avatar toby07801 toby07801 - change - 11 Oct 2023
The description was changed
avatar toby07801 toby07801 - edited - 11 Oct 2023
avatar brianteeman
brianteeman - comment - 11 Oct 2023

Turning the text filters off doesn't stop tinymce from preventing invalid html.

There is nothing that joomla can do to allow you to paste this html. You can test it yourself on a pure tinymce demo here https://www.tiny.cloud/docs/demo/classic/ where the effect is the same.

The slightly good news for you is that tinymce v6 does its job slightly differently and corrects your code in a better way (for you). You can test this at https://www.tiny.cloud/docs/tinymce/6/classic-demo/

Tinymce v6 is in Joomla 5 which is scheduled to be released in a week.

avatar toby07801
toby07801 - comment - 11 Oct 2023

Thanks for the update. That does look promising.

Is there no way to tell TinyMCE to not do any code filtering for Super Users AT ALL that anybody is aware of? That seems like a fairly straightforward thing to have as a feature as it essentially just means "do absolutely nothing" to the code.

I'm not sure I understand at all what the purpose of having an "extended allowed" field is, which their documentation states can accept wildcards, if this is then just completely ignored. Similarly, what is the purpose of the switch "Use Joomla Filter" if again this setting appears to not be respected, and it just does its own thing without as much as a warning that code has been removed.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42117.
avatar brianteeman
brianteeman - comment - 11 Oct 2023

Is there no way to tell TinyMCE to not do any code filtering for Super Users AT ALL that anybody is aware of?

No.

avatar joomdonation joomdonation - close - 24 Feb 2024
avatar joomdonation
joomdonation - comment - 24 Feb 2024

Closing this issue because this is handled by TinyMCE and Joomla could not do anything change this behavior as pointed out by @brianteeman

avatar joomdonation joomdonation - change - 24 Feb 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-02-24 10:06:41
Closed_By joomdonation

Add a Comment

Login with GitHub to post a comment