function CKEditor5CacheTag::onSave

Same name and namespace in other branches
  1. 9 core/modules/ckeditor5/src/EventSubscriber/CKEditor5CacheTag.php \Drupal\ckeditor5\EventSubscriber\CKEditor5CacheTag::onSave()
  2. 10 core/modules/ckeditor5/src/EventSubscriber/CKEditor5CacheTag.php \Drupal\ckeditor5\EventSubscriber\CKEditor5CacheTag::onSave()

Invalidates cache tags when particular system config objects are saved.

Parameters

\Drupal\Core\Config\ConfigCrudEvent $event: The Event to process.

File

core/modules/ckeditor5/src/EventSubscriber/CKEditor5CacheTag.php, line 43

Class

CKEditor5CacheTag
A subscriber invalidating cache tags when the default theme changes.

Namespace

Drupal\ckeditor5\EventSubscriber

Code

public function onSave(ConfigCrudEvent $event) {
    $config_name = $event->getConfig()
        ->getName();
    // Ckeditor5-stylesheets settings may change when the default theme changes.
    if ($config_name === 'system.theme' && $event->isChanged('default')) {
        // @see ckeditor5_library_info_alter()
        $this->cacheTagsInvalidator
            ->invalidateTags([
            'library_info',
        ]);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.