Commit 9bd93907 authored by webchick's avatar webchick

Issue #2579887 by StryKaizer, hussainweb, dawehner: EntityListBuilder requires cache tags

parent 1cdbe865
......@@ -228,6 +228,7 @@ public function render() {
'#empty' => $this->t('There is no @label yet.', array('@label' => $this->entityType->getLabel())),
'#cache' => [
'contexts' => $this->entityType->getListCacheContexts(),
'tags' => $this->entityType->getListCacheTags(),
],
);
foreach ($this->load() as $entity) {
......
......@@ -70,4 +70,12 @@ public function testCacheContexts() {
$this->assertEqual(['entity_test_view_grants', 'languages:' . LanguageInterface::TYPE_INTERFACE, 'theme', 'url.query_args.pagers:0', 'user.permissions'], $build['#cache']['contexts']);
}
/**
* Tests if the list cache tags are set.
*/
public function testCacheTags() {
$this->drupalGet('entity_test/list');
$this->assertCacheTag('entity_test_list');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment