diff --git a/core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php b/core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php index f42baa3..8654712 100644 --- a/core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php +++ b/core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php @@ -63,9 +63,6 @@ public function viewElements(FieldItemListInterface $items) { '#type' => 'link', '#title' => $string, '#url' => Url::fromUri($url), - '#cache' => array( - 'tags' => $items->getEntity()->getCacheTags(), - ), ]; } else { diff --git a/core/modules/file/src/Tests/Formatter/FileEntityFormatterTest.php b/core/modules/file/src/Tests/Formatter/FileEntityFormatterTest.php index 06d1997..1c9a275 100644 --- a/core/modules/file/src/Tests/Formatter/FileEntityFormatterTest.php +++ b/core/modules/file/src/Tests/Formatter/FileEntityFormatterTest.php @@ -84,7 +84,6 @@ public function testFormatterFileLink() { $entity_display->setComponent('filename', ['type' => 'file_link']); $build = $entity_display->buildMultiple($this->files)[0]['filename'][0]; - $this->assertTrue(in_array($this->files[0]->getCacheTags()[0], $build['#cache']['tags']), 'File cache tag found'); $this->assertEqual('file.png', $build['#title']); $this->assertEqual(Url::fromUri(file_create_url('public://file.png')), $build['#url']); }