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
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3217732-6.patch | 1.55 KB | bnjmnm |
Issue fork drupal-3217732
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:
- 3217732-filterstatus-behavior-cant
changes, plain diff MR !761
Comments
Comment #3
bnjmnmComment #4
wim leersComment #5
wim leersTests 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
FunctionalJavascriptorNightwatchtest, 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. 👍
Comment #6
bnjmnmAdding patch so it can be used by #3215597: CKEditor 5 plugin settings form available always, even when the plugin is not enabled tests.
Comment #8
lauriiiCommitted 53c2be8 and pushed to 9.3.x. Thanks!
Leaving open for potential backport to 9.2.x.
Comment #9
lauriiiDiscussed with @xjm and decided to backport to 9.2.x since this is low risk change that helps CKE5.
Comment #12
wim leersThis was a weakness introduced in #1894644: Unidirectional editor configuration -> filter settings syncing.