diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php b/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php index 1e816e2..6fd2170 100644 --- a/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php +++ b/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php @@ -81,7 +81,7 @@ public function initDisplay(ViewExecutable $view, array &$display, array &$optio $request_content_type = $negotiation->getContentType($request); // Only set the requested content type if it's not html. if ($request_content_type === 'html') { - if (\Drupal::moduleHandler()->moduleExists('hal_json')) { + if (\Drupal::moduleHandler()->moduleExists('hal')) { $this->setContentType('hal_json'); } } diff --git a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php index 260361d..4824307 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php @@ -129,13 +129,13 @@ public function testSerializerResponses() { // Test that by default the output will be JSON if hal is enabled. $expected = $serializer->serialize($entities, 'hal_json'); - $actual_xml = $this->drupalGet('test/serialize/entity'); - $this->assertIdentical($actual_xml, $expected, 'If hal modul is enabled by default hal_json output is returned.'); + $actual = $this->drupalGet('test/serialize/entity'); + $this->assertIdentical($actual, $expected, 'If hal module is enabled by default hal_json output is returned.'); - module_disable('hal'); + module_disable(array('hal')); $expected = $serializer->serialize($entities, 'json'); - $actual_xml = $this->drupalGet('test/serialize/entity'); - $this->assertIdentical($actual_xml, $expected, 'By default json output is returned.'); + $actual = $this->drupalGet('test/serialize/entity'); + $this->assertIdentical($actual, $expected, 'By default json output is returned.'); } /**