Commit 400baf16 authored by catch's avatar catch

Issue #2464427 by jibran, Wim Leers, Berdir, borisson_: Replace...

Issue #2464427 by jibran, Wim Leers, Berdir, borisson_: Replace CacheablePluginInterface with CacheableDependencyInterface
parent 07662ec6
...@@ -143,7 +143,7 @@ display: ...@@ -143,7 +143,7 @@ display:
- 'languages:language_interface' - 'languages:language_interface'
- url.query_args - url.query_args
- user.permissions - user.permissions
cacheable: false max-age: 0
feed_1: feed_1:
display_plugin: feed display_plugin: feed
id: feed_1 id: feed_1
...@@ -401,7 +401,7 @@ display: ...@@ -401,7 +401,7 @@ display:
- 'languages:language_content' - 'languages:language_content'
- 'languages:language_interface' - 'languages:language_interface'
- user.permissions - user.permissions
cacheable: false max-age: 0
page_1: page_1:
display_plugin: page display_plugin: page
id: page_1 id: page_1
...@@ -423,4 +423,4 @@ display: ...@@ -423,4 +423,4 @@ display:
- 'languages:language_interface' - 'languages:language_interface'
- url.query_args - url.query_args
- user.permissions - user.permissions
cacheable: false max-age: 0
...@@ -468,7 +468,8 @@ display: ...@@ -468,7 +468,8 @@ display:
- url - url
- url.query_args - url.query_args
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
page_1: page_1:
display_plugin: page display_plugin: page
id: page_1 id: page_1
...@@ -492,4 +493,5 @@ display: ...@@ -492,4 +493,5 @@ display:
- url - url
- url.query_args - url.query_args
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
...@@ -3,6 +3,7 @@ status: true ...@@ -3,6 +3,7 @@ status: true
dependencies: dependencies:
module: module:
- comment - comment
- node
- user - user
id: comments_recent id: comments_recent
label: 'Recent comments' label: 'Recent comments'
...@@ -241,7 +242,8 @@ display: ...@@ -241,7 +242,8 @@ display:
- 'languages:language_content' - 'languages:language_content'
- 'languages:language_interface' - 'languages:language_interface'
- user.permissions - user.permissions
cacheable: false max-age: -1
tags: { }
block_1: block_1:
display_plugin: block display_plugin: block
id: block_1 id: block_1
...@@ -258,4 +260,5 @@ display: ...@@ -258,4 +260,5 @@ display:
- 'languages:language_content' - 'languages:language_content'
- 'languages:language_interface' - 'languages:language_interface'
- user.permissions - user.permissions
cacheable: false max-age: -1
tags: { }
...@@ -200,4 +200,4 @@ display: ...@@ -200,4 +200,4 @@ display:
contexts: contexts:
- languages - languages
- user - user
cacheable: false max-age: 0
...@@ -133,7 +133,7 @@ display: ...@@ -133,7 +133,7 @@ display:
contexts: contexts:
- 'languages:language_content' - 'languages:language_content'
- 'languages:language_interface' - 'languages:language_interface'
cacheable: false max-age: 0
page_1: page_1:
display_plugin: page display_plugin: page
id: page_1 id: page_1
...@@ -146,4 +146,4 @@ display: ...@@ -146,4 +146,4 @@ display:
contexts: contexts:
- 'languages:language_content' - 'languages:language_content'
- 'languages:language_interface' - 'languages:language_interface'
cacheable: false max-age: 0
...@@ -117,4 +117,4 @@ display: ...@@ -117,4 +117,4 @@ display:
contexts: contexts:
- languages - languages
- 'languages:language_interface' - 'languages:language_interface'
cacheable: false max-age: 0
...@@ -118,4 +118,4 @@ display: ...@@ -118,4 +118,4 @@ display:
- entity_test_view_grants - entity_test_view_grants
- languages - languages
- 'languages:language_interface' - 'languages:language_interface'
cacheable: false max-age: 0
...@@ -127,4 +127,4 @@ display: ...@@ -127,4 +127,4 @@ display:
- entity_test_view_grants - entity_test_view_grants
- languages - languages
- 'languages:language_interface' - 'languages:language_interface'
cacheable: false max-age: 0
...@@ -126,4 +126,4 @@ display: ...@@ -126,4 +126,4 @@ display:
contexts: contexts:
- languages - languages
- 'languages:language_interface' - 'languages:language_interface'
cacheable: false max-age: 0
...@@ -723,7 +723,8 @@ display: ...@@ -723,7 +723,8 @@ display:
- url - url
- url.query_args - url.query_args
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
page_1: page_1:
display_plugin: page display_plugin: page
id: page_1 id: page_1
...@@ -759,7 +760,8 @@ display: ...@@ -759,7 +760,8 @@ display:
- url - url
- url.query_args - url.query_args
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
page_2: page_2:
display_plugin: page display_plugin: page
id: page_2 id: page_2
...@@ -1115,4 +1117,5 @@ display: ...@@ -1115,4 +1117,5 @@ display:
- url - url
- url.query_args - url.query_args
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
...@@ -102,9 +102,9 @@ public function adminSummary() { ...@@ -102,9 +102,9 @@ public function adminSummary() {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function isCacheable() { public function getCacheMaxAge() {
// This filter depends on the current time and therefore is never cacheable. // This filter depends on the current time and therefore is never cacheable.
return FALSE; return 0;
} }
} }
langcode: en langcode: en
status: false status: false
dependencies: dependencies:
config:
- core.entity_view_mode.node.teaser
module: module:
- node - node
- user
id: archive id: archive
label: Archive label: Archive
module: node module: node
...@@ -174,7 +177,8 @@ display: ...@@ -174,7 +177,8 @@ display:
- url.query_args - url.query_args
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: -1
tags: { }
block_1: block_1:
id: block_1 id: block_1
display_title: Block display_title: Block
...@@ -212,7 +216,8 @@ display: ...@@ -212,7 +216,8 @@ display:
- url.query_args - url.query_args
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: -1
tags: { }
page_1: page_1:
id: page_1 id: page_1
display_title: Page display_title: Page
...@@ -231,4 +236,5 @@ display: ...@@ -231,4 +236,5 @@ display:
- url.query_args - url.query_args
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: -1
tags: { }
...@@ -568,7 +568,8 @@ display: ...@@ -568,7 +568,8 @@ display:
- user - user
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
page_1: page_1:
display_options: display_options:
path: admin/content/node path: admin/content/node
...@@ -599,4 +600,5 @@ display: ...@@ -599,4 +600,5 @@ display:
- user - user
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
...@@ -296,7 +296,8 @@ display: ...@@ -296,7 +296,8 @@ display:
- user - user
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
block_1: block_1:
display_plugin: block display_plugin: block
id: block_1 id: block_1
...@@ -311,4 +312,5 @@ display: ...@@ -311,4 +312,5 @@ display:
- user - user
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
langcode: en langcode: en
status: true status: true
dependencies: dependencies:
config:
- core.entity_view_mode.node.rss
- core.entity_view_mode.node.teaser
module: module:
- node - node
- user - user
...@@ -244,7 +247,8 @@ display: ...@@ -244,7 +247,8 @@ display:
- url.query_args - url.query_args
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: -1
tags: { }
feed_1: feed_1:
display_plugin: feed display_plugin: feed
id: feed_1 id: feed_1
...@@ -278,7 +282,8 @@ display: ...@@ -278,7 +282,8 @@ display:
- 'languages:language_interface' - 'languages:language_interface'
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: -1
tags: { }
page_1: page_1:
display_options: display_options:
path: node path: node
...@@ -293,4 +298,5 @@ display: ...@@ -293,4 +298,5 @@ display:
- url.query_args - url.query_args
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: -1
tags: { }
...@@ -355,7 +355,8 @@ display: ...@@ -355,7 +355,8 @@ display:
- url.query_args - url.query_args
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
attachment_1: attachment_1:
id: attachment_1 id: attachment_1
display_title: Attachment display_title: Attachment
...@@ -422,7 +423,8 @@ display: ...@@ -422,7 +423,8 @@ display:
- url.query_args - url.query_args
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
page_1: page_1:
id: page_1 id: page_1
display_title: Page display_title: Page
...@@ -448,4 +450,5 @@ display: ...@@ -448,4 +450,5 @@ display:
- url.query_args - url.query_args
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: 0
tags: { }
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
namespace Drupal\node\Plugin\views\argument_default; namespace Drupal\node\Plugin\views\argument_default;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\views\Plugin\CacheablePluginInterface;
use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase; use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -23,7 +24,7 @@ ...@@ -23,7 +24,7 @@
* title = @Translation("Content ID from URL") * title = @Translation("Content ID from URL")
* ) * )
*/ */
class Node extends ArgumentDefaultPluginBase implements CacheablePluginInterface { class Node extends ArgumentDefaultPluginBase implements CacheableDependencyInterface {
/** /**
* The route match. * The route match.
...@@ -75,8 +76,8 @@ public function getArgument() { ...@@ -75,8 +76,8 @@ public function getArgument() {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function isCacheable() { public function getCacheMaxAge() {
return TRUE; return Cache::PERMANENT;
} }
/** /**
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
namespace Drupal\rest\Plugin\views\style; namespace Drupal\rest\Plugin\views\style;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\CacheablePluginInterface;
use Drupal\views\ViewExecutable; use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\style\StylePluginBase; use Drupal\views\Plugin\views\style\StylePluginBase;
...@@ -27,7 +28,7 @@ ...@@ -27,7 +28,7 @@
* display_types = {"data"} * display_types = {"data"}
* ) * )
*/ */
class Serializer extends StylePluginBase implements CacheablePluginInterface { class Serializer extends StylePluginBase implements CacheableDependencyInterface {
/** /**
* Overrides \Drupal\views\Plugin\views\style\StylePluginBase::$usesRowPlugin. * Overrides \Drupal\views\Plugin\views\style\StylePluginBase::$usesRowPlugin.
...@@ -155,8 +156,8 @@ public function getFormats() { ...@@ -155,8 +156,8 @@ public function getFormats() {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function isCacheable() { public function getCacheMaxAge() {
return TRUE; return Cache::PERMANENT;
} }
/** /**
...@@ -166,4 +167,11 @@ public function getCacheContexts() { ...@@ -166,4 +167,11 @@ public function getCacheContexts() {
return ['request_format']; return ['request_format'];
} }
/**
* {@inheritdoc}
*/
public function getCacheTags() {
return [];
}
} }
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
namespace Drupal\system\Plugin\views\field; namespace Drupal\system\Plugin\views\field;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\RevisionableInterface; use Drupal\Core\Entity\RevisionableInterface;
...@@ -15,7 +16,6 @@ ...@@ -15,7 +16,6 @@
use Drupal\Core\Routing\RedirectDestinationTrait; use Drupal\Core\Routing\RedirectDestinationTrait;
use Drupal\Core\TypedData\TranslatableInterface; use Drupal\Core\TypedData\TranslatableInterface;
use Drupal\views\Entity\Render\EntityTranslationRenderTrait; use Drupal\views\Entity\Render\EntityTranslationRenderTrait;
use Drupal\views\Plugin\CacheablePluginInterface;
use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\Plugin\views\field\UncacheableFieldHandlerTrait; use Drupal\views\Plugin\views\field\UncacheableFieldHandlerTrait;
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* *
* @ViewsField("bulk_form") * @ViewsField("bulk_form")
*/ */
class BulkForm extends FieldPluginBase implements CacheablePluginInterface { class BulkForm extends FieldPluginBase implements CacheableDependencyInterface {
use RedirectDestinationTrait; use RedirectDestinationTrait;
use UncacheableFieldHandlerTrait; use UncacheableFieldHandlerTrait;
...@@ -114,10 +114,10 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o ...@@ -114,10 +114,10 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function isCacheable() { public function getCacheMaxAge() {
// @todo Consider making the bulk operation form cacheable. See // @todo Consider making the bulk operation form cacheable. See
// https://www.drupal.org/node/2503009. // https://www.drupal.org/node/2503009.
return FALSE; return 0;
} }
/** /**
...@@ -127,6 +127,13 @@ public function getCacheContexts() { ...@@ -127,6 +127,13 @@ public function getCacheContexts() {
return $this->languageManager->isMultilingual() ? $this->getEntityTranslationRenderer()->getCacheContexts() : []; return $this->languageManager->isMultilingual() ? $this->getEntityTranslationRenderer()->getCacheContexts() : [];
} }
/**
* {@inheritdoc}
*/
public function getCacheTags() {
return [];
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
......
...@@ -59,6 +59,7 @@ public function testPostUpdate() { ...@@ -59,6 +59,7 @@ public function testPostUpdate() {
$this->assertIdentical($updates, \Drupal::state()->get('post_update_test_execution', [])); $this->assertIdentical($updates, \Drupal::state()->get('post_update_test_execution', []));
$key_value = \Drupal::keyValue('post_update'); $key_value = \Drupal::keyValue('post_update');
array_unshift($updates, 'views_post_update_update_cacheability_metadata');
array_unshift($updates, 'block_post_update_disable_blocks_with_missing_contexts'); array_unshift($updates, 'block_post_update_disable_blocks_with_missing_contexts');
$this->assertEqual($updates, $key_value->get('existing_updates')); $this->assertEqual($updates, $key_value->get('existing_updates'));
......
...@@ -249,7 +249,8 @@ display: ...@@ -249,7 +249,8 @@ display:
- url.query_args - url.query_args
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: -1
tags: { }
feed_1: feed_1:
id: feed_1 id: feed_1
display_title: Feed display_title: Feed
...@@ -286,7 +287,8 @@ display: ...@@ -286,7 +287,8 @@ display:
- url - url
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: -1
tags: { }
page_1: page_1:
id: page_1 id: page_1
display_title: Page display_title: Page
...@@ -305,4 +307,5 @@ display: ...@@ -305,4 +307,5 @@ display:
- url.query_args - url.query_args
- 'user.node_grants:view' - 'user.node_grants:view'
- user.permissions - user.permissions
cacheable: false max-age: -1
tags: { }