diff --git a/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php b/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php index 48dbb81b47..a0b5b89a20 100644 --- a/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php +++ b/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php @@ -82,10 +82,10 @@ public function normalize($field_item, $format = NULL, array $context = []) { // Normalize the target entity. $embedded = $this->serializer->normalize($target_entity, $format, $context); - $link = $embedded['_links']['self']; // If the field is translatable, add the langcode to the link relation // object. This does not indicate the language of the target entity. - if ($langcode) { + $link = $embedded['_links']['self'] ?? NULL; + if ($link && $langcode) { $embedded['lang'] = $link['lang'] = $langcode; } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 9a8d8c999c..b44430c7fc 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -648,7 +648,7 @@ function template_preprocess_node(&$variables) { unset($variables['elements']['uid']); } - if (!$skip_custom_preprocessing || !$node->getFieldDefinition('title')->isDisplayConfigurable('view')) { + if (isset($variables['elements']['title']) && (!$skip_custom_preprocessing || !$node->getFieldDefinition('title')->isDisplayConfigurable('view'))) { $variables['label'] = $variables['elements']['title']; unset($variables['elements']['title']); } diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module index 6dced6adab..d09886bcbb 100644 --- a/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -495,7 +495,7 @@ function rdf_preprocess_comment(&$variables) { } // Adds RDFa markup for the date of the comment. $created_mapping = $mapping->getPreparedFieldMapping('created'); - if (!empty($created_mapping)) { + if (!empty($created_mapping) && isset($comment->rdf_data)) { // The comment date is precomputed as part of the rdf_data so that it can be // cached as part of the entity. $date_attributes = $comment->rdf_data['date'];