diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Data.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Data.php index c038810..1f4d4aa 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Data.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Data.php @@ -91,16 +91,16 @@ public function setContentType($content_type) { * content type from the request. */ public function getContentType() { - if (isset($this->contentType)) { - return $this->contentType; - } + if (!isset($this->contentType)) { + // Return the content type based on the request object. + $negotiation = drupal_container()->get('content_negotiation'); + $request = drupal_container()->get('request'); + $content_type = $negotiation->getContentType($request); - // Return the content type based on the request object. - $negotiation = drupal_container()->get('content_negotiation'); - $request = drupal_container()->get('request'); - $content_type = $negotiation->getContentType($request); + $this->setContentType($request->getMimeType($content_type)); + } - return $request->getMimeType($content_type); + return $this->contentType; } /**