diff --git a/core/modules/block_content/config/install/views.view.block_content.yml b/core/modules/block_content/config/install/views.view.block_content.yml index 2ed9764..4e87489 100644 --- a/core/modules/block_content/config/install/views.view.block_content.yml +++ b/core/modules/block_content/config/install/views.view.block_content.yml @@ -418,7 +418,7 @@ display: admin_label: '' empty: true tokenize: false - content: 'There are no custom blocks available.' + content: 'There are no custom blocks available. ' plugin_id: text_custom block_content_listing_empty: admin_label: '' @@ -434,6 +434,11 @@ display: relationships: { } arguments: { } display_extenders: { } + cache_metadata: + contexts: + 0: cache.context.url + 2: language + cacheable: false page_1: display_plugin: page id: page_1 @@ -450,3 +455,8 @@ display: weight: 0 context: '0' menu_name: admin + cache_metadata: + contexts: + 0: cache.context.url + 2: language + cacheable: false diff --git a/core/modules/block_content/src/Plugin/views/area/ListingEmpty.php b/core/modules/block_content/src/Plugin/views/area/ListingEmpty.php index 3bc4e95..d772f46 100644 --- a/core/modules/block_content/src/Plugin/views/area/ListingEmpty.php +++ b/core/modules/block_content/src/Plugin/views/area/ListingEmpty.php @@ -73,15 +73,10 @@ public static function create(ContainerInterface $container, array $configuratio */ public function render($empty = FALSE) { if (!$empty || !empty($this->options['empty'])) { + /** @var \Drupal\Core\Access\AccessResultInterface|\Drupal\Core\Cache\CacheableInterface $access_result */ $access_result = $this->accessManager->checkNamedRoute('block_content.add_page', array(), $this->currentUser, TRUE); $element = array( - '#theme' => 'links', - '#links' => array( - array( - 'url' => Url::fromRoute('block_content.add_page'), - 'title' => $this->t('Add a custom block'), - ), - ), + '#markup' => $this->t('Add a custom block.', array('!url' => Url::fromRoute('block_content.add_page')->toString())), '#access' => $access_result->isAllowed(), '#cache' => [ 'contexts' => $access_result->getCacheContexts(),