diff --git a/core/modules/rest/src/Plugin/views/style/Serializer.php b/core/modules/rest/src/Plugin/views/style/Serializer.php index 4e7c373..fe98f8e 100644 --- a/core/modules/rest/src/Plugin/views/style/Serializer.php +++ b/core/modules/rest/src/Plugin/views/style/Serializer.php @@ -127,8 +127,7 @@ public function render() { // Get the content type configured in the display or fallback to the // default. - $default_content_type = empty($this->view->live_preview) ? $this->displayHandler->getContentType() : 'json'; - $content_type = $this->options['formats'] ? reset($this->options['formats']) : $default_content_type; + $content_type = $this->options['formats'] ? reset($this->options['formats']) : $this->displayHandler->getContentType(); return $this->serializer->serialize($rows, $content_type); } diff --git a/core/modules/rest/src/Tests/Views/StyleSerializerTest.php b/core/modules/rest/src/Tests/Views/StyleSerializerTest.php index 16775a8..3ab6f79 100644 --- a/core/modules/rest/src/Tests/Views/StyleSerializerTest.php +++ b/core/modules/rest/src/Tests/Views/StyleSerializerTest.php @@ -126,7 +126,7 @@ public function testSerializerResponses() { /** * Tests the response format configuration. */ - public function testResponseFormatConfiguration() { + public function testReponseFormatConfiguration() { $this->drupalLogin($this->adminUser); $style_options = 'admin/structure/views/nojs/display/test_serializer_display_field/rest_export_1/style_options';