diff --git a/core/modules/hal/src/Normalizer/FieldNormalizer.php b/core/modules/hal/src/Normalizer/FieldNormalizer.php index e7f2890..fd2851b 100644 --- a/core/modules/hal/src/Normalizer/FieldNormalizer.php +++ b/core/modules/hal/src/Normalizer/FieldNormalizer.php @@ -69,8 +69,6 @@ public function denormalize($data, $class, $format = NULL, array $context = arra } $field = $context['target_instance']; - echo __METHOD__ . PHP_EOL; - echo print_r($data, true) . PHP_EOL; foreach ($data as $field_item_data) { $count = $field->count(); // Get the next field item instance. The offset will serve as the field diff --git a/core/modules/rest/src/Plugin/views/display/RestExport.php b/core/modules/rest/src/Plugin/views/display/RestExport.php index 6b16070..629d674 100644 --- a/core/modules/rest/src/Plugin/views/display/RestExport.php +++ b/core/modules/rest/src/Plugin/views/display/RestExport.php @@ -272,17 +272,15 @@ public function execute() { parent::execute(); $output = $this->view->render(); + // In JSONP mode? - $callback = $this->view->getRequest()->get('callback'); - $jsonp = $this->view->getRequest()->get('jsonp'); - if ($callback || $jsonp) { - if ($jsonp) { - $callback = $jsonp; - } + $callback = $this->view->getRequest()->get('jsonp') ?: $this->view->getRequest()->get('callback'); + if ($callback) { $response = new JsonResponse(drupal_render_root($output), 200, array()); $response->setCallback($callback); return $response; } + return new Response(drupal_render_root($output), 200, array('Content-type' => $this->getMimeType())); }