core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php | 2 ++ core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php | 2 ++ core/modules/editor/src/Element.php | 1 + core/modules/editor/src/Tests/EditorLoadingTest.php | 2 ++ core/modules/editor/src/Tests/EditorSecurityTest.php | 2 ++ core/modules/filter/src/Element/TextFormat.php | 2 ++ 6 files changed, 11 insertions(+) diff --git a/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php b/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php index 1081eb9..92e694e 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php @@ -7,6 +7,7 @@ namespace Drupal\ckeditor\Tests; +use Drupal\Core\Cache\Cache; use Drupal\simpletest\WebTestBase; /** @@ -126,6 +127,7 @@ function testLoading() { // configuration also results in modified CKEditor configuration, so we // don't test that here. \Drupal::service('module_installer')->install(array('ckeditor_test')); + Cache::invalidateTags(['rendered']); $this->container->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions(); $editor_settings = $editor->getSettings(); $editor_settings['toolbar']['rows'][0][0]['items'][] = 'Llama'; diff --git a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php index 327a354..4346827 100644 --- a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php +++ b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php @@ -78,6 +78,7 @@ public function testCacheTags() { 'config:field.field.entity_test.entity_test.comment', 'config:field.storage.comment.comment_body', 'config:user.settings', + 'user:1', ]; sort($expected_cache_tags); $this->assertEqual($build['#cache']['tags'], $expected_cache_tags); @@ -124,6 +125,7 @@ public function testCacheTags() { 'config:field.field.entity_test.entity_test.comment', 'config:field.storage.comment.comment_body', 'config:user.settings', + 'user:1', ]; sort($expected_cache_tags); $this->assertEqual($build['#cache']['tags'], $expected_cache_tags); diff --git a/core/modules/editor/src/Element.php b/core/modules/editor/src/Element.php index 43b99ba..41ffedf 100644 --- a/core/modules/editor/src/Element.php +++ b/core/modules/editor/src/Element.php @@ -53,6 +53,7 @@ function preRenderTextFormat(array $element) { $format_ids = array_keys($element['format']['format']['#options']); // Early-return if no text editor is associated with any of the text formats. + $element['#cache']['tags'][] = 'config:editor_list'; $editors = Editor::loadMultiple($format_ids); foreach ($editors as $key => $editor) { $definition = $this->pluginManager->getDefinition($editor->getEditor()); diff --git a/core/modules/editor/src/Tests/EditorLoadingTest.php b/core/modules/editor/src/Tests/EditorLoadingTest.php index 002ccd3..95dda17 100644 --- a/core/modules/editor/src/Tests/EditorLoadingTest.php +++ b/core/modules/editor/src/Tests/EditorLoadingTest.php @@ -245,6 +245,7 @@ public function testSupportedElementTypes() { // Assert the unicorn editor works with textfields. $this->drupalLogin($this->privilegedUser); $this->drupalGet('node/1/edit'); + $this->assertCacheTag('config:editor_list'); list( , $editor_settings_present, $editor_js_present, $field, $format_selector) = $this->getThingsToCheck('field-text', 'input'); $this->assertTrue($editor_settings_present, "Text Editor module's JavaScript settings are on the page."); $this->assertTrue($editor_js_present, 'Text Editor JavaScript is present.'); @@ -261,6 +262,7 @@ public function testSupportedElementTypes() { ))->save(); $this->drupalGet('node/1/edit'); + $this->assertCacheTag('config:editor_list'); list( , $editor_settings_present, $editor_js_present, $field, $format_selector) = $this->getThingsToCheck('field-text', 'input'); $this->assertFalse($editor_settings_present, "Text Editor module's JavaScript settings are not on the page."); $this->assertFalse($editor_js_present, 'Text Editor JavaScript is not present.'); diff --git a/core/modules/editor/src/Tests/EditorSecurityTest.php b/core/modules/editor/src/Tests/EditorSecurityTest.php index bb39450..db15b05 100644 --- a/core/modules/editor/src/Tests/EditorSecurityTest.php +++ b/core/modules/editor/src/Tests/EditorSecurityTest.php @@ -8,6 +8,7 @@ namespace Drupal\editor\Tests; use Drupal\Component\Serialization\Json; +use Drupal\Core\Cache\Cache; use Drupal\simpletest\WebTestBase; /** @@ -428,6 +429,7 @@ function testEditorXssFilterOverride() { // Enable editor_test.module's hook_editor_xss_filter_alter() implementation // to alter the text editor XSS filter class being used. \Drupal::state()->set('editor_test_editor_xss_filter_alter_enabled', TRUE); + Cache::invalidateTags(['rendered']); // First: the Insecure text editor XSS filter. $this->drupalGet('node/2/edit'); diff --git a/core/modules/filter/src/Element/TextFormat.php b/core/modules/filter/src/Element/TextFormat.php index 9247dba..9b3000f 100644 --- a/core/modules/filter/src/Element/TextFormat.php +++ b/core/modules/filter/src/Element/TextFormat.php @@ -210,6 +210,8 @@ public static function processFormat(&$element, FormStateInterface $form_state, $user_has_access = isset($formats[$element['#format']]); $user_is_admin = $user->hasPermission('administer filters'); + $element['#cache']['tags'][] = 'config:filter_format_list'; + // If the stored format does not exist or if it is not among the allowed // formats for this textarea, administrators have to assign a new format. if ((!$format_exists || !$format_allowed) && $user_is_admin) {