Unsaved allowed html tags are lost when adding a plugin

Created on 4 November 2015, over 9 years ago
Updated 25 January 2025, 11 days ago

Problem/Motivation

While editiing a text format that uses the limit allowed tags filter, if you add some tags to the allowed html tags then drag a plugin to the toolbar before having saved, you lose your changes.

Steps to reproduce:

  1. install Drupal standard
  2. edit basic HTML format (admin/config/content/formats/manage/basic_html)
  3. add <i> to the allowed html tags field (for example)
  4. add title to the <a> allowed attributes
  5. drag any button to the toolbar

Expected result: the <i> and the <a title> stays allowed
Current result: the <i> and the <a title> are removed from the allowed tags

Proposed resolution

In core/modules/filter/filter.filter_html.admin.js fix Drupal.behaviors.filterFilterHtmlUpdating._updateAllowedTags so it takes the values from the allowed HTML tags field.

Remaining tasks

<!-- See https://drupal.org/core-mentoring/novice-tasks for tips on identifying novice tasks. Delete or add "Novice" from the Novice? column in the table below as appropriate. Uncomment tasks as the issue advances. Update the Complete? column to indicate when they are done, and maybe reference the comment number where they were done. -->

User interface changes

Fixes the bug.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Closed: outdated

Version

11.0 🔥

Component

filter.module

Created by

🇫🇷France duaelfr Montpellier, France

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

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

  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

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.

  • 🇳🇿New Zealand quietone

    I too can't reproduce this on Drupal 11 with CKEditor5. But the 'allowed tags' are now read only so can't follow the steps exactly.

Production build 0.71.5 2024