diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 33a5946..4564994 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -227,36 +227,10 @@ function block_get_blocks_by_region($region) { */ function _block_get_renderable_region($list = array()) { $build = array(); - // Block caching is not compatible with node_access modules. We also - // preserve the submission of forms in blocks, by fetching from cache - // only if the request method is 'GET' (or 'HEAD'). User 1 being out of - // the regular 'roles define permissions' schema, it brings too many - // chances of having unwanted output get in the cache and later be served - // to other users. We therefore exclude user 1 from block caching. - $not_cacheable = \Drupal::currentUser()->id() == 1 || - count(\Drupal::moduleHandler()->getImplementations('node_grants')) || - !\Drupal::request()->isMethodSafe(); foreach ($list as $key => $block) { - $settings = $block->get('settings'); - if ($not_cacheable || in_array($settings['cache'], array(DRUPAL_NO_CACHE, DRUPAL_CACHE_CUSTOM))) { - // Non-cached blocks get built immediately. - if ($block->access()) { - $build[$key] = entity_view($block, 'block'); - } - } - else { - $build[$key] = array( - '#block' => $block, - '#weight' => $block->get('weight'), - '#pre_render' => array('_block_get_renderable_block'), - '#cache' => array( - 'keys' => array($key, $settings['module']), - 'granularity' => $settings['cache'], - 'bin' => 'block', - 'tags' => array('content' => TRUE), - ), - ); + if ($block->access()) { + $build[$key] = entity_view($block, 'block'); } // Add contextual links for this block; skip the main content block, since diff --git a/core/modules/block/lib/Drupal/block/BlockBase.php b/core/modules/block/lib/Drupal/block/BlockBase.php index 48e469b..38058dc 100644 --- a/core/modules/block/lib/Drupal/block/BlockBase.php +++ b/core/modules/block/lib/Drupal/block/BlockBase.php @@ -32,7 +32,6 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi 'label' => '', 'module' => $plugin_definition['module'], 'label_display' => BlockInterface::BLOCK_LABEL_VISIBLE, - 'cache' => DRUPAL_NO_CACHE, ); } diff --git a/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php b/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php index 2f2eaac..424ddef 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php +++ b/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php @@ -48,7 +48,6 @@ protected function defineOptions() { $options['block_description'] = array('default' => '', 'translatable' => TRUE); $options['block_category'] = array('default' => 'Lists (Views)', 'translatable' => TRUE); - $options['block_caching'] = array('default' => DRUPAL_NO_CACHE); $options['block_hide_empty'] = array('default' => FALSE); $options['allow'] = array( @@ -133,13 +132,6 @@ public function optionsSummary(&$categories, &$options) { 'value' => empty($filtered_allow) ? t('None') : t('Items per page'), ); - $types = $this->blockCachingModes(); - $options['block_caching'] = array( - 'category' => 'other', - 'title' => t('Block caching'), - 'value' => $types[$this->getCacheType()], - ); - $options['block_hide_empty'] = array( 'category' => 'other', 'title' => t('Hide block if the view output is empty'), @@ -148,33 +140,6 @@ public function optionsSummary(&$categories, &$options) { } /** - * Provide a list of core's block caching modes. - */ - protected function blockCachingModes() { - return array( - DRUPAL_NO_CACHE => t('Do not cache'), - DRUPAL_CACHE_GLOBAL => t('Cache once for everything (global)'), - DRUPAL_CACHE_PER_PAGE => t('Per page'), - DRUPAL_CACHE_PER_ROLE => t('Per role'), - DRUPAL_CACHE_PER_ROLE | DRUPAL_CACHE_PER_PAGE => t('Per role per page'), - DRUPAL_CACHE_PER_USER => t('Per user'), - DRUPAL_CACHE_PER_USER | DRUPAL_CACHE_PER_PAGE => t('Per user per page'), - ); - } - - /** - * Provide a single method to figure caching type, keeping a sensible default - * for when it's unset. - */ - public function getCacheType() { - $cache_type = $this->getOption('block_caching'); - if (empty($cache_type)) { - $cache_type = DRUPAL_NO_CACHE; - } - return $cache_type; - } - - /** * Provide the default form for setting options. */ public function buildOptionsForm(&$form, &$form_state) { @@ -198,16 +163,6 @@ public function buildOptionsForm(&$form, &$form_state) { '#default_value' => $this->getOption('block_category'), ); break; - case 'block_caching': - $form['#title'] .= t('Block caching type'); - - $form['block_caching'] = array( - '#type' => 'radios', - '#description' => t("This sets the default status for Drupal's built-in block caching method; this requires that caching be turned on in block administration, and be careful because you have little control over when this cache is flushed."), - '#options' => $this->blockCachingModes(), - '#default_value' => $this->getCacheType(), - ); - break; case 'block_hide_empty': $form['#title'] .= t('Block empty settings'); @@ -253,7 +208,6 @@ public function submitOptionsForm(&$form, &$form_state) { switch ($form_state['section']) { case 'block_description': case 'block_category': - case 'block_caching': case 'allow': case 'block_hide_empty': $this->setOption($form_state['section'], $form_state['values'][$form_state['section']]); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php deleted file mode 100644 index 6206dbb..0000000 --- a/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php +++ /dev/null @@ -1,205 +0,0 @@ - 'Block caching', - 'description' => 'Test block caching.', - 'group' => 'Block', - ); - } - - function setUp() { - parent::setUp(); - - // Create an admin user, log in and enable test blocks. - $this->admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages')); - $this->drupalLogin($this->admin_user); - - // Create additional users to test caching modes. - $this->normal_user = $this->drupalCreateUser(); - $this->normal_user_alt = $this->drupalCreateUser(); - // Sync the roles, since drupalCreateUser() creates separate roles for - // the same permission sets. - $this->normal_user_alt->roles = $this->normal_user->getRoles(); - $this->normal_user_alt->save(); - - // Enable our test block. - $this->block = $this->drupalPlaceBlock('test_cache'); - } - - /** - * Test DRUPAL_CACHE_PER_ROLE. - */ - function testCachePerRole() { - $this->setCacheMode(DRUPAL_CACHE_PER_ROLE); - - // Enable our test block. Set some content for it to display. - $current_content = $this->randomName(); - \Drupal::state()->set('block_test.content', $current_content); - $this->drupalLogin($this->normal_user); - $this->drupalGet(''); - $this->assertText($current_content, 'Block content displays.'); - - // Change the content, but the cached copy should still be served. - $old_content = $current_content; - $current_content = $this->randomName(); - \Drupal::state()->set('block_test.content', $current_content); - $this->drupalGet(''); - $this->assertText($old_content, 'Block is served from the cache.'); - - // Clear the cache and verify that the stale data is no longer there. - cache_invalidate_tags(array('content' => TRUE)); - $this->drupalGet(''); - $this->assertNoText($old_content, 'Block cache clear removes stale cache data.'); - $this->assertText($current_content, 'Fresh block content is displayed after clearing the cache.'); - - // Test whether the cached data is served for the correct users. - $old_content = $current_content; - $current_content = $this->randomName(); - \Drupal::state()->set('block_test.content', $current_content); - $this->drupalLogout(); - $this->drupalGet(''); - $this->assertNoText($old_content, 'Anonymous user does not see content cached per-role for normal user.'); - - $this->drupalLogin($this->normal_user_alt); - $this->drupalGet(''); - $this->assertText($old_content, 'User with the same roles sees per-role cached content.'); - - $this->drupalLogin($this->admin_user); - $this->drupalGet(''); - $this->assertNoText($old_content, 'Admin user does not see content cached per-role for normal user.'); - - $this->drupalLogin($this->normal_user); - $this->drupalGet(''); - $this->assertText($old_content, 'Block is served from the per-role cache.'); - } - - /** - * Test DRUPAL_CACHE_GLOBAL. - */ - function testCacheGlobal() { - $this->setCacheMode(DRUPAL_CACHE_GLOBAL); - $current_content = $this->randomName(); - \Drupal::state()->set('block_test.content', $current_content); - - $this->drupalGet(''); - $this->assertText($current_content, 'Block content displays.'); - - $old_content = $current_content; - $current_content = $this->randomName(); - \Drupal::state()->set('block_test.content', $current_content); - - $this->drupalLogout(); - $this->drupalGet('user'); - $this->assertText($old_content, 'Block content served from global cache.'); - } - - /** - * Test DRUPAL_NO_CACHE. - */ - function testNoCache() { - $this->setCacheMode(DRUPAL_NO_CACHE); - $current_content = $this->randomName(); - \Drupal::state()->set('block_test.content', $current_content); - - // If DRUPAL_NO_CACHE has no effect, the next request would be cached. - $this->drupalGet(''); - $this->assertText($current_content, 'Block content displays.'); - - // A cached copy should not be served. - $current_content = $this->randomName(); - \Drupal::state()->set('block_test.content', $current_content); - $this->drupalGet(''); - $this->assertText($current_content, 'DRUPAL_NO_CACHE prevents blocks from being cached.'); - } - - /** - * Test DRUPAL_CACHE_PER_USER. - */ - function testCachePerUser() { - $this->setCacheMode(DRUPAL_CACHE_PER_USER); - $current_content = $this->randomName(); - \Drupal::state()->set('block_test.content', $current_content); - $this->drupalLogin($this->normal_user); - - $this->drupalGet(''); - $this->assertText($current_content, 'Block content displays.'); - - $old_content = $current_content; - $current_content = $this->randomName(); - \Drupal::state()->set('block_test.content', $current_content); - - $this->drupalGet(''); - $this->assertText($old_content, 'Block is served from per-user cache.'); - - $this->drupalLogin($this->normal_user_alt); - $this->drupalGet(''); - $this->assertText($current_content, 'Per-user block cache is not served for other users.'); - - $this->drupalLogin($this->normal_user); - $this->drupalGet(''); - $this->assertText($old_content, 'Per-user block cache is persistent.'); - } - - /** - * Test DRUPAL_CACHE_PER_PAGE. - */ - function testCachePerPage() { - $this->setCacheMode(DRUPAL_CACHE_PER_PAGE); - $current_content = $this->randomName(); - \Drupal::state()->set('block_test.content', $current_content); - - $this->drupalGet('node'); - $this->assertText($current_content, 'Block content displays on the node page.'); - - $old_content = $current_content; - $current_content = $this->randomName(); - \Drupal::state()->set('block_test.content', $current_content); - - $this->drupalGet('user'); - $this->assertNoText($old_content, 'Block content cached for the node page does not show up for the user page.'); - $this->drupalGet('node'); - $this->assertText($old_content, 'Block content cached for the node page.'); - } - - /** - * Private helper method to set the test block's cache mode. - */ - private function setCacheMode($cache_mode) { - $this->block->getPlugin()->setConfigurationValue('cache', $cache_mode); - $this->block->save(); - } - -} diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php index 3f22caa..cc1abd6 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php @@ -48,7 +48,6 @@ public function testBlockInterface() { 'display_message' => 'no message set', 'module' => 'block_test', 'label_display' => BlockInterface::BLOCK_LABEL_VISIBLE, - 'cache' => DRUPAL_NO_CACHE, ); // Initial configuration of the block at construction time. $display_block = $manager->createInstance('test_block_instantiation', $configuration); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageCacheTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageCacheTest.php deleted file mode 100644 index 5fec407..0000000 --- a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageCacheTest.php +++ /dev/null @@ -1,85 +0,0 @@ - 'Multilingual blocks', - 'description' => 'Checks display of menu blocks with multiple languages.', - 'group' => 'Block', - ); - } - - public function setUp() { - parent::setUp(); - - // Create test languages. - $this->langcodes = array(language_load('en')); - for ($i = 1; $i < 3; ++$i) { - $language = new Language(array( - 'id' => 'l' . $i, - 'name' => $this->randomString(), - )); - language_save($language); - $this->langcodes[$i] = $language; - } - } - - /** - * Creates a block in a language, check blocks page in all languages. - */ - public function testBlockLinks() { - // Create admin user to be able to access block admin. - $admin_user = $this->drupalCreateUser(array( - 'administer blocks', - 'access administration pages', - 'administer menu', - )); - $this->drupalLogin($admin_user); - - // Create the block cache for all languages. - foreach ($this->langcodes as $langcode) { - $this->drupalGet('admin/structure/block', array('language' => $langcode)); - } - - // Create a menu in the default language. - $edit['label'] = $this->randomName(); - $edit['id'] = Unicode::strtolower($edit['label']); - $this->drupalPostForm('admin/structure/menu/add', $edit, t('Save')); - $this->assertText(t('Menu @label has been added.', array('@label' => $edit['label']))); - - // Check that the block is listed for all languages. - foreach ($this->langcodes as $langcode) { - $this->drupalGet('admin/structure/block', array('language' => $langcode)); - $this->assertText($edit['label']); - } - } -} diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php index 82827ab..05ff191 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php @@ -99,7 +99,6 @@ protected function createTests() { 'region' => -1, 'plugin' => 'test_html_id', 'settings' => array( - 'cache' => 1, 'label' => '', 'module' => 'block_test', 'label_display' => BlockInterface::BLOCK_LABEL_VISIBLE, diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index af49957..cb09834 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -245,37 +245,4 @@ function moveBlockToRegion(array $block, $region) { )); $this->assertFieldByXPath($xpath, NULL, t('Block found in %region_name region.', array('%region_name' => drupal_html_class($region)))); } - - /** - * Test _block_rehash(). - */ - function testBlockRehash() { - \Drupal::moduleHandler()->install(array('block_test')); - $this->assertTrue(module_exists('block_test'), 'Test block module enabled.'); - - // Clear the block cache to load the block_test module's block definitions. - $this->container->get('plugin.manager.block')->clearCachedDefinitions(); - - // Add a test block. - $block = array(); - $block['id'] = 'test_cache'; - $block['theme'] = \Drupal::config('system.theme')->get('default'); - $block['region'] = 'header'; - $block = $this->drupalPlaceBlock('test_cache', array('region' => 'header')); - - // Our test block's caching should default to DRUPAL_CACHE_PER_ROLE. - $settings = $block->get('settings'); - $this->assertEqual($settings['cache'], DRUPAL_CACHE_PER_ROLE, 'Test block cache mode defaults to DRUPAL_CACHE_PER_ROLE.'); - - // Disable caching for this block. - $block->getPlugin()->setConfigurationValue('cache', DRUPAL_NO_CACHE); - $block->save(); - // Flushing all caches should call _block_rehash(). - $this->resetAll(); - // Verify that block is updated with the new caching mode. - $block = entity_load('block', $block->id()); - $settings = $block->get('settings'); - $this->assertEqual($settings['cache'], DRUPAL_NO_CACHE, "Test block's database entry updated to DRUPAL_NO_CACHE."); - } - } diff --git a/core/modules/block/tests/Drupal/block/Tests/BlockBaseTest.php b/core/modules/block/tests/Drupal/block/Tests/BlockBaseTest.php index f0d04ec..8d96c33 100644 --- a/core/modules/block/tests/Drupal/block/Tests/BlockBaseTest.php +++ b/core/modules/block/tests/Drupal/block/Tests/BlockBaseTest.php @@ -12,11 +12,6 @@ use Drupal\Core\Transliteration\PHPTransliteration; use Drupal\Tests\UnitTestCase; -// @todo Remove once the constants are replaced with constants on classes. -if (!defined('DRUPAL_NO_CACHE')) { - define('DRUPAL_NO_CACHE', -1); -} - /** * Tests the base block plugin. * diff --git a/core/modules/block/tests/modules/block_test/config/block.block.test_block.yml b/core/modules/block/tests/modules/block_test/config/block.block.test_block.yml index 4b68aca..9f0fdc6 100644 --- a/core/modules/block/tests/modules/block_test/config/block.block.test_block.yml +++ b/core/modules/block/tests/modules/block_test/config/block.block.test_block.yml @@ -9,7 +9,6 @@ settings: label: 'Test block html id"' module: block_test label_display: '0' - cache: '1' visibility: path: visibility: '0' diff --git a/core/modules/block/tests/modules/block_test/lib/Drupal/block_test/Plugin/Block/TestCacheBlock.php b/core/modules/block/tests/modules/block_test/lib/Drupal/block_test/Plugin/Block/TestCacheBlock.php index c26780a..4ef5b4b 100644 --- a/core/modules/block/tests/modules/block_test/lib/Drupal/block_test/Plugin/Block/TestCacheBlock.php +++ b/core/modules/block/tests/modules/block_test/lib/Drupal/block_test/Plugin/Block/TestCacheBlock.php @@ -23,21 +23,10 @@ class TestCacheBlock extends BlockBase { /** * {@inheritdoc} - * - * Sets a different caching strategy for testing purposes. - */ - public function defaultConfiguration() { - return array( - 'cache' => DRUPAL_CACHE_PER_ROLE, - ); - } - - /** - * {@inheritdoc} */ public function build() { return array( - '#children' => \Drupal::state()->get('block_test.content'), + '#markup' => \Drupal::state()->get('block_test.content'), ); } diff --git a/core/modules/block/tests/modules/block_test/lib/Drupal/block_test/Plugin/Block/TestXSSTitleBlock.php b/core/modules/block/tests/modules/block_test/lib/Drupal/block_test/Plugin/Block/TestXSSTitleBlock.php index cca6794..a6bc13f 100644 --- a/core/modules/block/tests/modules/block_test/lib/Drupal/block_test/Plugin/Block/TestXSSTitleBlock.php +++ b/core/modules/block/tests/modules/block_test/lib/Drupal/block_test/Plugin/Block/TestXSSTitleBlock.php @@ -18,16 +18,4 @@ * ) */ class TestXSSTitleBlock extends TestCacheBlock { - - /** - * {@inheritdoc} - * - * Sets a different caching strategy for testing purposes. - */ - public function defaultConfiguration() { - return array( - 'cache' => DRUPAL_NO_CACHE, - ); - } - } diff --git a/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php b/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php index 4e794f1..036e5bc 100644 --- a/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php +++ b/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php @@ -27,7 +27,6 @@ class BookNavigationBlock extends BlockBase { */ public function defaultConfiguration() { return array( - 'cache' => DRUPAL_CACHE_PER_PAGE | DRUPAL_CACHE_PER_ROLE, 'block_mode' => "all pages", ); } @@ -63,6 +62,13 @@ public function blockSubmit($form, &$form_state) { */ public function build() { $current_bid = 0; + $cache['#cache'] = array( + 'keys' => array('book_navigation', 'book'), + 'granularity' => DRUPAL_CACHE_PER_PAGE | DRUPAL_CACHE_PER_ROLE, + 'bin' => 'block', + // @todo Save tags for each entity in the book. + 'tags' => array('content' => TRUE), + ); if ($node = menu_get_object()) { $current_bid = empty($node->book['bid']) ? 0 : $node->book['bid']; } @@ -90,7 +96,7 @@ public function build() { if ($book_menus) { return array( '#theme' => 'book_all_books_block', - ) + $book_menus; + ) + $book_menus + $cache; } } elseif ($current_bid) { @@ -108,7 +114,7 @@ public function build() { $below = \Drupal::service('book.manager')->bookTreeOutput($data['below']); if (!empty($below)) { $book_title_link = array('#theme' => 'book_title_link', '#link' => $data['link']); - return array( + return $cache + array( '#title' => drupal_render($book_title_link), $below, ); diff --git a/core/modules/forum/lib/Drupal/forum/Plugin/Block/ActiveTopicsBlock.php b/core/modules/forum/lib/Drupal/forum/Plugin/Block/ActiveTopicsBlock.php index 3c7aa2a..d1b489b 100644 --- a/core/modules/forum/lib/Drupal/forum/Plugin/Block/ActiveTopicsBlock.php +++ b/core/modules/forum/lib/Drupal/forum/Plugin/Block/ActiveTopicsBlock.php @@ -33,6 +33,8 @@ public function build() { ->range(0, $this->configuration['block_count']); return array( + // @todo Needs cache tags. Fix by converting to a View with result cache. + // Then remove drupal_render_cache_by_query(). drupal_render_cache_by_query($query, 'forum_block_view'), ); } diff --git a/core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php b/core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php index c2ad994..4cdb94a 100644 --- a/core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php +++ b/core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php @@ -20,7 +20,6 @@ */ public function defaultConfiguration() { return array( - 'cache' => DRUPAL_CACHE_CUSTOM, 'properties' => array( 'administrative' => TRUE, ), diff --git a/core/modules/language/lib/Drupal/language/Plugin/Derivative/LanguageBlock.php b/core/modules/language/lib/Drupal/language/Plugin/Derivative/LanguageBlock.php index a329c3b..9bf1dee 100644 --- a/core/modules/language/lib/Drupal/language/Plugin/Derivative/LanguageBlock.php +++ b/core/modules/language/lib/Drupal/language/Plugin/Derivative/LanguageBlock.php @@ -23,7 +23,6 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { foreach ($configurable_types as $type) { $this->derivatives[$type] = $base_plugin_definition; $this->derivatives[$type]['admin_label'] = t('Language switcher (!type)', array('!type' => $info[$type]['name'])); - $this->derivatives[$type]['cache'] = DRUPAL_NO_CACHE; } // If there is just one configurable type then change the title of the // block. diff --git a/core/modules/system/lib/Drupal/system/Plugin/Derivative/SystemMenuBlock.php b/core/modules/system/lib/Drupal/system/Plugin/Derivative/SystemMenuBlock.php index 5542808..0c1d37f 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/Derivative/SystemMenuBlock.php +++ b/core/modules/system/lib/Drupal/system/Plugin/Derivative/SystemMenuBlock.php @@ -52,7 +52,6 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { foreach ($this->menuStorage->loadMultiple() as $menu => $entity) { $this->derivatives[$menu] = $base_plugin_definition; $this->derivatives[$menu]['admin_label'] = $entity->label(); - $this->derivatives[$menu]['cache'] = DRUPAL_NO_CACHE; } return $this->derivatives; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php index 30d242a..c8ba106 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php @@ -102,7 +102,6 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { $this->derivatives[$delta] = array( 'category' => $display->getOption('block_category'), 'admin_label' => $desc, - 'cache' => $display->getCacheType() ); $this->derivatives[$delta] += $base_plugin_definition; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php index 96bdd4c..a85efa3 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php @@ -93,7 +93,6 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { $desc = t('Exposed form: @view-@display_id', array('@view' => $view->id(), '@display_id' => $display->display['id'])); $this->derivatives[$delta] = array( 'admin_label' => $desc, - 'cache' => DRUPAL_NO_CACHE, ); $this->derivatives[$delta] += $base_plugin_definition; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index 4faffc7..1eae6ae 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -2729,7 +2729,6 @@ public function getSpecialBlocks() { $blocks[$delta] = array( 'info' => $desc, - 'cache' => DRUPAL_NO_CACHE, ); } diff --git a/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php index bcfd88b..385b677 100644 --- a/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php @@ -15,9 +15,6 @@ if (!defined('BLOCK_LABEL_VISIBLE')) { define('BLOCK_LABEL_VISIBLE', 'visible'); } -if (!defined('DRUPAL_NO_CACHE')) { - define('DRUPAL_NO_CACHE', -1); -} /** * Tests the views block plugin. diff --git a/core/profiles/minimal/config/block.block.stark_admin.yml b/core/profiles/minimal/config/block.block.stark_admin.yml index 1c11ab5..4a97153 100644 --- a/core/profiles/minimal/config/block.block.stark_admin.yml +++ b/core/profiles/minimal/config/block.block.stark_admin.yml @@ -9,7 +9,6 @@ settings: label: Administration module: system label_display: visible - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/minimal/config/block.block.stark_login.yml b/core/profiles/minimal/config/block.block.stark_login.yml index a727ff5..5fe2ed7 100644 --- a/core/profiles/minimal/config/block.block.stark_login.yml +++ b/core/profiles/minimal/config/block.block.stark_login.yml @@ -9,7 +9,6 @@ settings: label: 'User login' module: user label_display: visible - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/minimal/config/block.block.stark_tools.yml b/core/profiles/minimal/config/block.block.stark_tools.yml index 6073ede..bb78801 100644 --- a/core/profiles/minimal/config/block.block.stark_tools.yml +++ b/core/profiles/minimal/config/block.block.stark_tools.yml @@ -9,7 +9,6 @@ settings: label: Tools module: system label_display: visible - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.bartik_breadcrumbs.yml b/core/profiles/standard/config/block.block.bartik_breadcrumbs.yml index c915c46..5bf1d6e 100644 --- a/core/profiles/standard/config/block.block.bartik_breadcrumbs.yml +++ b/core/profiles/standard/config/block.block.bartik_breadcrumbs.yml @@ -10,7 +10,6 @@ settings: label: Breadcrumbs module: system label_display: '0' - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.bartik_content.yml b/core/profiles/standard/config/block.block.bartik_content.yml index 5b7187b..11b355f 100644 --- a/core/profiles/standard/config/block.block.bartik_content.yml +++ b/core/profiles/standard/config/block.block.bartik_content.yml @@ -10,7 +10,6 @@ settings: label: 'Main page content' module: system label_display: '0' - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.bartik_footer.yml b/core/profiles/standard/config/block.block.bartik_footer.yml index 2ad2766..e7aa271 100644 --- a/core/profiles/standard/config/block.block.bartik_footer.yml +++ b/core/profiles/standard/config/block.block.bartik_footer.yml @@ -10,7 +10,6 @@ settings: label: 'Footer menu' module: system label_display: visible - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.bartik_help.yml b/core/profiles/standard/config/block.block.bartik_help.yml index c697560..3d44a22 100644 --- a/core/profiles/standard/config/block.block.bartik_help.yml +++ b/core/profiles/standard/config/block.block.bartik_help.yml @@ -10,7 +10,6 @@ settings: label: 'System Help' module: system label_display: '0' - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.bartik_login.yml b/core/profiles/standard/config/block.block.bartik_login.yml index e94f562..408608c 100644 --- a/core/profiles/standard/config/block.block.bartik_login.yml +++ b/core/profiles/standard/config/block.block.bartik_login.yml @@ -10,7 +10,6 @@ settings: label: 'User login' module: user label_display: visible - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.bartik_powered.yml b/core/profiles/standard/config/block.block.bartik_powered.yml index 265f271..b8aab83 100644 --- a/core/profiles/standard/config/block.block.bartik_powered.yml +++ b/core/profiles/standard/config/block.block.bartik_powered.yml @@ -10,7 +10,6 @@ settings: label: 'Powered by Drupal' module: system label_display: '0' - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.bartik_search.yml b/core/profiles/standard/config/block.block.bartik_search.yml index d37e197..f2ad36a 100644 --- a/core/profiles/standard/config/block.block.bartik_search.yml +++ b/core/profiles/standard/config/block.block.bartik_search.yml @@ -10,7 +10,6 @@ settings: label: Search module: search label_display: visible - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.bartik_tools.yml b/core/profiles/standard/config/block.block.bartik_tools.yml index b940651..ca68f47 100644 --- a/core/profiles/standard/config/block.block.bartik_tools.yml +++ b/core/profiles/standard/config/block.block.bartik_tools.yml @@ -10,7 +10,6 @@ settings: label: Tools module: system label_display: visible - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.seven_breadcrumbs.yml b/core/profiles/standard/config/block.block.seven_breadcrumbs.yml index d314031..0305fa4 100644 --- a/core/profiles/standard/config/block.block.seven_breadcrumbs.yml +++ b/core/profiles/standard/config/block.block.seven_breadcrumbs.yml @@ -10,7 +10,6 @@ settings: label: Breadcrumbs module: system label_display: '0' - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.seven_content.yml b/core/profiles/standard/config/block.block.seven_content.yml index 39f26ff..0cd8d02 100644 --- a/core/profiles/standard/config/block.block.seven_content.yml +++ b/core/profiles/standard/config/block.block.seven_content.yml @@ -10,7 +10,6 @@ settings: label: 'Main page content' module: system label_display: '0' - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.seven_help.yml b/core/profiles/standard/config/block.block.seven_help.yml index 8536232..087bba9 100644 --- a/core/profiles/standard/config/block.block.seven_help.yml +++ b/core/profiles/standard/config/block.block.seven_help.yml @@ -10,7 +10,6 @@ settings: label: 'System Help' module: system label_display: '0' - cache: '-1' visibility: path: visibility: '0' diff --git a/core/profiles/standard/config/block.block.seven_login.yml b/core/profiles/standard/config/block.block.seven_login.yml index d3e62fa..a34238d 100644 --- a/core/profiles/standard/config/block.block.seven_login.yml +++ b/core/profiles/standard/config/block.block.seven_login.yml @@ -10,7 +10,6 @@ settings: label: 'User login' module: user label_display: visible - cache: '-1' visibility: path: visibility: '0'