Magento – CMS and Block content warning Magento 2.4.2

2.4.2cmspage-content

Does anyone have any information or details on the following warning that I am seeing in the 2.4.2 CMS and Block content areas on saving?

Temporarily allowed to save HTML value that contains restricted
elements. Allowed HTML tags are: div, a, p, span, em, strong, ul, li,
ol, h5, h4, h3, h2, h1, table, tbody, tr, td, th, tfoot, img, hr,
figure, button, i, u, br, b

It appears to be produced by saving content with Html that contains things like data toggles, iFrame embeds, etc. I've got WYSIWYG turned off globally, but the warning still gets produced.

I believe it has shown up after my Magento 2.4.1 – 2.4.2 upgrade, but can't seem to find any information online in regards to the warning, so I'm wondering if anyone has any info here.

A few questions, in hopes that someone can answer or link to an official doc:

Are data-toggles, iframes, and such going to be eliminated in a future release of Magento?

How soon do we have? Next version? Magento 2.5?

Will we be able to whitelist some/all of these items for use in admin content areas?

Thanks for any insight or help.
R

Best Answer

I experienced this error too this morning and I dug a little :

Magento\Cms\Model\Wysiwyg\Validator is responsible of this notification. ATM, it seems that it just shoot a message with no repercussion.

Based on the code, there is a boolean from Magento configuration, that allows us to decide if we do accept or block html content with restricted html tags. Depending on this YES/NO option, the code will shoot a notification or throw an Exception.

The configuration key is cms/wysiwyg/force_valid.

It is defined in vendor/magento/module-cms/etc/config.xml (value = false), but does not appear in vendor/magento/module-cms/etc/adminhtml/system.xml. So there is no way to change that value from the admin panel ATM.

I guess it could be easy to add it if needed. IMO, Magento would probably do it on their own if they decided to switch the default value to true in the future.

Related Topic