diff --git a/core/modules/node/src/Tests/Views/NodeLanguageTest.php b/core/modules/node/src/Tests/Views/NodeLanguageTest.php index 942f35b..16b2705 100644 --- a/core/modules/node/src/Tests/Views/NodeLanguageTest.php +++ b/core/modules/node/src/Tests/Views/NodeLanguageTest.php @@ -9,7 +9,6 @@ use Drupal\field\Entity\FieldStorageConfig; use Drupal\language\Entity\ConfigurableLanguage; -use Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait; use Drupal\views\Plugin\views\PluginBase; use Drupal\views\Tests\ViewTestData; use Drupal\views\Views; @@ -21,8 +20,6 @@ */ class NodeLanguageTest extends NodeTestBase { - use AssertPageCacheContextsAndTagsTrait; - /** * {@inheritdoc} */ diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginInterface.php b/core/modules/views/src/Plugin/views/display/DisplayPluginInterface.php index 630705f..c1aba0c 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginInterface.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginInterface.php @@ -467,8 +467,8 @@ public function execute(); /** * Builds a basic render array which can be properly render cached. * - * In order to be rendered cached, it includes the "#cache['keys']" as well - * as did not loaded the view yet at all. + * In order to be rendered cached, it includes cache keys as well as the data + * required to load the view on cache misses. * * @param string $view_id * The view ID. diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php index fa9ce1f..193979e 100644 --- a/core/modules/views/src/Plugin/views/display/Page.php +++ b/core/modules/views/src/Plugin/views/display/Page.php @@ -159,6 +159,9 @@ public static function buildBasicRenderable($view_id, $display_id, array $args = $build['#view_display_plugin_id'] = $route->getOption('_view_display_plugin_id'); $build['#view_display_show_admin_links'] = $route->getOption('_view_display_show_admin_links'); } + else { + throw new \BadFunctionCallException('Missing route parameters.'); + } return $build; } diff --git a/core/modules/views/src/Plugin/views/display/ResponseDisplayPluginInterface.php b/core/modules/views/src/Plugin/views/display/ResponseDisplayPluginInterface.php index fbf31a1..4541572 100644 --- a/core/modules/views/src/Plugin/views/display/ResponseDisplayPluginInterface.php +++ b/core/modules/views/src/Plugin/views/display/ResponseDisplayPluginInterface.php @@ -10,8 +10,8 @@ /** * Defines a display which returns a Response object. * - * This interface is meant to be used for display plugins, which don't return - * HTML but rather JSON, XML or some other format. + * This interface is meant to be used for display plugins, which do return some + * other format requiring to return a response directly. */ interface ResponseDisplayPluginInterface extends DisplayPluginInterface { diff --git a/core/modules/views/src/Tests/Plugin/CacheTagTest.php b/core/modules/views/src/Tests/Plugin/CacheTagTest.php index 219857f..3d497d5 100644 --- a/core/modules/views/src/Tests/Plugin/CacheTagTest.php +++ b/core/modules/views/src/Tests/Plugin/CacheTagTest.php @@ -92,8 +92,7 @@ protected function setUp() { $this->user = $this->drupalCreateUser(); // Mark the current request safe, in order to make render cache working, see - // \Drupal\Core\Render\RenderCache::get - // @see https://www.drupal.org/node/2367555 + // \Drupal\Core\Render\RenderCache::get. \Drupal::request()->setMethod('GET'); } diff --git a/core/modules/views/src/Tests/RenderCacheIntegrationTest.php b/core/modules/views/src/Tests/RenderCacheIntegrationTest.php index f734ae6..d498ac3 100644 --- a/core/modules/views/src/Tests/RenderCacheIntegrationTest.php +++ b/core/modules/views/src/Tests/RenderCacheIntegrationTest.php @@ -138,7 +138,8 @@ protected function assertCacheTagsForFieldBasedView($do_assert_views_caches) { $entities[0]->name->value = $random_name = $this->randomMachineName(); $entities[0]->save(); $build = $this->assertViewsCacheTags($view, $tags_page_2, $do_assert_views_caches, $tags_page_2); - // @todo Static render arrays don't support different pages yet. + // @todo Static render arrays don't support different pages yet, see + // https://www.drupal.org/node/2500701. // $this->assertViewsCacheTagsFromStaticRenderArray($view, $tags_page_2, $do_assert_views_caches); $this->assertTrue(strpos($build['#markup'], $random_name) !== FALSE); $view->destroy(); @@ -167,6 +168,8 @@ protected function assertCacheTagsForFieldBasedView($do_assert_views_caches) { $this->assertEqual((string) $result[0]->div->span, (string) $entity->id()); }; + // Execute the view once with a static renderable and one with a full + // prepared render array. $tags_argument = Cache::mergeTags($base_tags, $entities[0]->getCacheTags()); $view->setArguments([$entities[0]->id()]); $build = $this->assertViewsCacheTags($view, $tags_argument, $do_assert_views_caches, $tags_argument); @@ -183,7 +186,6 @@ protected function assertCacheTagsForFieldBasedView($do_assert_views_caches) { $single_entity_assertions($build, $entities[1]); $view->destroy(); - } /**