Broken "Allowed Tags" updating: after all values for an attribute are allowed, it should not be overridden to allow only certain attribute values

Created on 20 April 2016, about 8 years ago
Updated 23 May 2023, about 1 year ago

Problem/Motivation

Basically, if you're using CKEditor with styles dropdown and "limit allowed HTML tags", automatic "allowed tags" updating can really trip you up.

Steps to reproduce:

  1. Add a new text format
  2. Configure it to use CKEditor
  3. Add "Styles" button to your "Active Toolbar"
  4. Add a "Styles dropdown" entry, like p.test|Test
  5. Enable "Limit allowed HTML tags and correct faulty HTML"
  6. Under "Allowed HTML tags" enter in <p class>
    • The significance of "class" with no set value is it allows all values
  7. Save the configuration
  8. Edit the configuration again
  9. You see this message:
    Based on the text editor configuration, these tags have automatically been added: <p class=" test">.
  10. The "Allowed HTML tags" now has <p class=" test">

This is unnecessary because <p class> allowed for class='test', but is worse because now only the test class is allowed. Of course, you can change this before you save, but you'll have to do it every time you edit the configuration.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

9.4

Component
Filter 

Last updated 2 days ago

No maintainer
Created by

🇺🇸United States charginghawk

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • JavaScript

    Affects the content, performance, or handling of Javascript.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇩Indonesia joe midd

    I appreciate your input, @Spokje. Considering that we are solely incorporating the "@group legacy" feature cara mengatasi stres into version 9.5.x, while the test remains unaffected in version 10.x, I believe this approach is acceptable and the most straightforward way to accomplish the task.

  • It appears that the current implementation for updating "Allowed Tags" is not behaving as intended. After all values for an attribute are allowed, the system should not override this to restrict the attribute to only certain values. This issue poses a significant challenge for maintaining consistency in attribute management.

    To address this, it's crucial to revisit the update logic and ensure that once all values are permitted for an attribute, subsequent updates do not narrow down the allowed values. This not only aligns with expected behavior but also enhances the flexibility and usability of the system.

    Moreover, a comprehensive test suite covering various scenarios related to attribute updates and allowed values could help identify and prevent such regressions in the future. Collaborative efforts in debugging and refining this aspect of the system will undoubtedly contribute to a more robust and reliable platform.

    Let's work together to rectify this issue and uphold the integrity of the "Allowed Tags" functionality. Your attention to this matter is highly appreciated.
    Thanks: Bungalows For Sale in Oakville

Production build 0.69.0 2024