Issue #2579887 by StryKaizer, hussainweb, dawehner: EntityListBuilder requires cache tags
parent
1cdbe865bc
commit
9bd9390755
|
@ -228,6 +228,7 @@ class EntityListBuilder extends EntityHandlerBase implements EntityListBuilderIn
|
|||
'#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 @@ class EntityListBuilderTest extends WebTestBase {
|
|||
$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');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue