Problem/Motivation

Part of the issue #3201641: Improve the HTML filter configuration UX includes updating filter settings via AJAX request. This breaks the association between enabling filters and their settings being available. This is due to the following: when enabling a filter, the JavaScript looks for a specific ID to find the filter settings it needs to show/hide. However, if the filtersettings were updated via AJAX, they do not have those specific ID's - they have the ID with an appended hash.

Steps to reproduce

Proposed resolution

When filter looks for settings based on the ID of the filter enable/disable checkbox, it should look for data-drupal-selector, which is always the same, instead of id, which can be appended with a hash.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#6 3217732-6.patch1.55 KBbnjmnm

Issue fork drupal-3217732

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bnjmnm created an issue. See original summary.

bnjmnm’s picture

Status: Active » Needs review
wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Tests do not make sense to write here because nothing in Drupal core does this. This affects a contrib use case. Also note that this change can only be tested using a FunctionalJavascript or Nightwatch test, and the Filter module has neither.

That is … until we bring CKEditor 5 to Drupal core!

Since this issue is simply hardening a selector to not be sensitive to the HTML ID randomization that was introduced nearly six years ago, and this therefore helps make the JS less brittle, I think it's totally reasonable to land this without additional explicit test coverage.

Manually tested, works fine. 👍

bnjmnm’s picture

  • lauriii committed 53c2be8 on 9.3.x
    Issue #3217732 by bnjmnm, Wim Leers: filterStatus behavior can't find...
lauriii’s picture

Version: 9.3.x-dev » 9.2.x-dev

Committed 53c2be8 and pushed to 9.3.x. Thanks!

Leaving open for potential backport to 9.2.x.

lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Discussed with @xjm and decided to backport to 9.2.x since this is low risk change that helps CKE5.

  • lauriii committed a669b98 on 9.2.x
    Issue #3217732 by bnjmnm, Wim Leers: filterStatus behavior can't find...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

wim leers’s picture