Skip to content
Snippets Groups Projects

Issue #2385047: Remove disabled filters from text format configuration

Open Issue #2385047: Remove disabled filters from text format configuration
1 unresolved thread
1 unresolved thread

Merge request reports

Members who can merge are allowed to add commits.
Code Quality is loading
Test summary results are being parsed
Ready to merge by members who can write to the target branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
110 110 // Remove configuration if it matches the defaults. In self::getAll(), we
111 111 // load all available filters, in addition to the enabled filters stored in
112 112 // configuration. In order to prevent those from bleeding through to the
113 // stored configuration, remove all filters that match the default values.
113 // stored configuration, remove all disabled filters or filters that match
114 // the default values.
114 115 // Because filters are disabled by default, this will never remove the
115 116 // configuration of an enabled filter.
116 117 foreach ($configuration as $instance_id => $instance_config) {
117 118 $default_config = [];
118 119 $default_config['id'] = $instance_id;
119 120 $default_config += $this->get($instance_id)->defaultConfiguration();
120 if ($default_config === $instance_config) {
121 if (empty($instance_config['status']) || $default_config === $instance_config) {
  • Handling the removal of disabled filters on the collection level since there's a chance that some modules with dynamic defaultConfiguration() definitions such as gutenberg (or any module with an incorrectly defined defaultConfiguration()) can potentially have an instance configuration which doesn't match the defaultConfiguration().

    This is because the default \Drupal\filter\Plugin\FilterBase::getConfiguration() call doesn't make a call to defaultConfiguration() in order to merge it. And will subsequently add the disabled module as a dependency even if it's no longer added to the exported config.

  • Please register or sign in to reply
  • Björn Brala added 1330 commits

    added 1330 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading