diff --git a/core/includes/common.inc b/core/includes/common.inc index 48e208c..1413671 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -4131,7 +4131,7 @@ function drupal_render_cache_set(&$markup, array $elements) { $data['#cache']['tags'] = $elements['#cache']['tags']; } - $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'cache'; + $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'render'; $expire = isset($elements['#cache']['expire']) ? $elements['#cache']['expire'] : Cache::PERMANENT; \Drupal::cache($bin)->set($cid, $data, $expire, $elements['#cache']['tags']); } diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index c7ae62b..a36bbe3 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -279,7 +279,7 @@ public function testBlockCacheTags() { $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT'); $cid_parts = array(url('', array('absolute' => TRUE)), 'html'); $cid = sha1(implode(':', $cid_parts)); - $cache_entry = \Drupal::cache('page')->get($cid); + $cache_entry = \Drupal::cache('render')->get($cid); $expected_cache_tags = array( 'content:1', 'block_view:1', diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php index b0616d5..690bbaf 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php @@ -496,7 +496,7 @@ function testDrupalRenderPostRenderCache() { // GET request: validate cached data. $element = array('#cache' => array('cid' => 'post_render_cache_test_GET')); - $cached_element = \Drupal::cache()->get(drupal_render_cid_create($element))->data; + $cached_element = \Drupal::cache('render')->get(drupal_render_cid_create($element))->data; $expected_element = array( '#markup' => '

#cache enabled, GET

', '#attached' => $test_element['#attached'], @@ -538,7 +538,7 @@ function testDrupalRenderPostRenderCache() { // POST request: Ensure no data was cached. $element = array('#cache' => array('cid' => 'post_render_cache_test_POST')); - $cached_element = \Drupal::cache()->get(drupal_render_cid_create($element)); + $cached_element = \Drupal::cache('render')->get(drupal_render_cid_create($element)); $this->assertFalse($cached_element, 'No data is cached because this is a POST request.'); // Restore the previous request method. @@ -603,7 +603,7 @@ function testDrupalRenderChildrenPostRenderCache() { // GET request: validate cached data. $element = array('#cache' => $element['#cache']); - $cached_element = \Drupal::cache()->get(drupal_render_cid_create($element))->data; + $cached_element = \Drupal::cache('render')->get(drupal_render_cid_create($element))->data; $expected_element = array( '#attached' => array( 'js' => array( @@ -686,8 +686,8 @@ function testDrupalRenderChildrenPostRenderCache() { $element = $test_element; $element['#cache']['keys'] = array('simpletest', 'drupal_render', 'children_post_render_cache', 'nested_cache_parent'); $element['child']['#cache']['keys'] = array('simpletest', 'drupal_render', 'children_post_render_cache', 'nested_cache_child'); - $cached_parent_element = \Drupal::cache()->get(drupal_render_cid_create($element))->data; - $cached_child_element = \Drupal::cache()->get(drupal_render_cid_create($element['child']))->data; + $cached_parent_element = \Drupal::cache('render')->get(drupal_render_cid_create($element))->data; + $cached_child_element = \Drupal::cache('render')->get(drupal_render_cid_create($element['child']))->data; $expected_parent_element = array( '#attached' => array( 'js' => array( @@ -816,7 +816,7 @@ function testDrupalRenderRenderCachePlaceholder() { $tokens = array_keys($element['#post_render_cache']['common_test_post_render_cache_placeholder']); $expected_token = $tokens[0]; $element = array('#cache' => array('cid' => 'render_cache_placeholder_test_GET')); - $cached_element = \Drupal::cache()->get(drupal_render_cid_create($element))->data; + $cached_element = \Drupal::cache('render')->get(drupal_render_cid_create($element))->data; // Parse unique token out of the cached markup. $dom = Html::load($cached_element['#markup']); $xpath = new \DOMXPath($dom); @@ -907,7 +907,7 @@ function testDrupalRenderChildElementRenderCachePlaceholder() { $parent_tokens = array_keys($element['#post_render_cache']['common_test_post_render_cache_placeholder']); $expected_token = $child_tokens[0]; $element = array('#cache' => array('cid' => 'render_cache_placeholder_test_child_GET')); - $cached_element = \Drupal::cache()->get(drupal_render_cid_create($element))->data; + $cached_element = \Drupal::cache('render')->get(drupal_render_cid_create($element))->data; // Parse unique token out of the cached markup. $dom = Html::load($cached_element['#markup']); $xpath = new \DOMXPath($dom); @@ -932,7 +932,7 @@ function testDrupalRenderChildElementRenderCachePlaceholder() { // GET request: validate cached data (for the parent/entire render array). $element = array('#cache' => array('cid' => 'render_cache_placeholder_test_GET')); - $cached_element = \Drupal::cache()->get(drupal_render_cid_create($element))->data; + $cached_element = \Drupal::cache('render')->get(drupal_render_cid_create($element))->data; // Parse unique token out of the cached markup. $dom = Html::load($cached_element['#markup']); $xpath = new \DOMXPath($dom); @@ -959,7 +959,7 @@ function testDrupalRenderChildElementRenderCachePlaceholder() { // Check the cache of the child element again after the parent has been // rendered. $element = array('#cache' => array('cid' => 'render_cache_placeholder_test_child_GET')); - $cached_element = \Drupal::cache()->get(drupal_render_cid_create($element))->data; + $cached_element = \Drupal::cache('render')->get(drupal_render_cid_create($element))->data; // Verify that the child element contains the correct // render_cache_placeholder markup. $expected_token = $child_tokens[0];