From c1e7cc2d98cfd2dd23ef0a0a32f5a0763cdfcb8b Mon Sep 17 00:00:00 2001 From: nod_ Date: Wed, 17 Jul 2024 15:21:44 +0200 Subject: [PATCH] Issue #3458612 by catch, longwave, ankitv18, Spokje: Remove legacy 'metadata' variable from node.html.twig --- core/modules/node/node.module | 5 +++++ core/modules/node/templates/node.html.twig | 2 -- .../umami/templates/content/node--article--full.html.twig | 1 - .../umami/templates/content/node--card-common-alt.html.twig | 1 - .../umami/templates/content/node--card-common.html.twig | 1 - .../themes/umami/templates/content/node--card.html.twig | 1 - .../demo_umami/themes/umami/templates/content/node.html.twig | 1 - core/themes/claro/templates/classy/content/node.html.twig | 1 - core/themes/olivero/templates/content/node--teaser.html.twig | 1 - core/themes/olivero/templates/content/node.html.twig | 1 - core/themes/stable9/templates/content/node.html.twig | 1 - .../themes/starterkit_theme/templates/content/node.html.twig | 1 - 12 files changed, 5 insertions(+), 12 deletions(-) diff --git a/core/modules/node/node.module b/core/modules/node/node.module index e0c49f01573..95c014d146c 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -481,6 +481,11 @@ function template_preprocess_node(&$variables) { $variables['deprecations']['teaser'] = "'teaser' is deprecated in drupal:11.1.0 and is removed in drupal:12.0.0. Use 'view_mode' instead. See https://www.drupal.org/node/3458185"; $variables['teaser'] = $variables['view_mode'] == 'teaser'; + // The 'metadata' variable was originally added to support RDF, which has now + // been moved to contrib. It was needed because it is not possible to + // extend the markup of the 'submitted' variable generically. + $variables['deprecations']['metadata'] = "'metadata' is deprecated in drupal:11.1.0 and is removed in drupal:12.0.0. There is no replacement. See https://www.drupal.org/node/3458638"; + $variables['node'] = $variables['elements']['#node']; /** @var \Drupal\node\NodeInterface $node */ $node = $variables['node']; diff --git a/core/modules/node/templates/node.html.twig b/core/modules/node/templates/node.html.twig index c27cbcf4068..4420ac103e8 100644 --- a/core/modules/node/templates/node.html.twig +++ b/core/modules/node/templates/node.html.twig @@ -22,7 +22,6 @@ * of a given child element. * - author_picture: The node author user entity, rendered using the "compact" * view mode. - * - metadata: Metadata for this node. * - date: (optional) Themed creation date field. * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. @@ -76,7 +75,6 @@ {{ author_picture }} {% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %} - {{ metadata }} {% endif %} diff --git a/core/profiles/demo_umami/themes/umami/templates/content/node--article--full.html.twig b/core/profiles/demo_umami/themes/umami/templates/content/node--article--full.html.twig index 0a50a15c570..060270cfe0e 100644 --- a/core/profiles/demo_umami/themes/umami/templates/content/node--article--full.html.twig +++ b/core/profiles/demo_umami/themes/umami/templates/content/node--article--full.html.twig @@ -22,7 +22,6 @@ * of a given child element. * - author_picture: The node author user entity, rendered using the "compact" * view mode. - * - metadata: Metadata for this node. * - date: (optional) Themed creation date field. * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. diff --git a/core/profiles/demo_umami/themes/umami/templates/content/node--card-common-alt.html.twig b/core/profiles/demo_umami/themes/umami/templates/content/node--card-common-alt.html.twig index 4e493934bf5..f325a67f00a 100644 --- a/core/profiles/demo_umami/themes/umami/templates/content/node--card-common-alt.html.twig +++ b/core/profiles/demo_umami/themes/umami/templates/content/node--card-common-alt.html.twig @@ -22,7 +22,6 @@ * of a given child element. * - author_picture: The node author user entity, rendered using the "compact" * view mode. - * - metadata: Metadata for this node. * - date: (optional) Themed creation date field. * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. diff --git a/core/profiles/demo_umami/themes/umami/templates/content/node--card-common.html.twig b/core/profiles/demo_umami/themes/umami/templates/content/node--card-common.html.twig index 5550eea9996..97f0c8e0120 100644 --- a/core/profiles/demo_umami/themes/umami/templates/content/node--card-common.html.twig +++ b/core/profiles/demo_umami/themes/umami/templates/content/node--card-common.html.twig @@ -22,7 +22,6 @@ * of a given child element. * - author_picture: The node author user entity, rendered using the "compact" * view mode. - * - metadata: Metadata for this node. * - date: (optional) Themed creation date field. * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. diff --git a/core/profiles/demo_umami/themes/umami/templates/content/node--card.html.twig b/core/profiles/demo_umami/themes/umami/templates/content/node--card.html.twig index adae60573d6..119c6684099 100644 --- a/core/profiles/demo_umami/themes/umami/templates/content/node--card.html.twig +++ b/core/profiles/demo_umami/themes/umami/templates/content/node--card.html.twig @@ -22,7 +22,6 @@ * of a given child element. * - author_picture: The node author user entity, rendered using the "compact" * view mode. - * - metadata: Metadata for this node. * - date: (optional) Themed creation date field. * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. diff --git a/core/profiles/demo_umami/themes/umami/templates/content/node.html.twig b/core/profiles/demo_umami/themes/umami/templates/content/node.html.twig index 2da813403de..7116a5ed29d 100644 --- a/core/profiles/demo_umami/themes/umami/templates/content/node.html.twig +++ b/core/profiles/demo_umami/themes/umami/templates/content/node.html.twig @@ -22,7 +22,6 @@ * of a given child element. * - author_picture: The node author user entity, rendered using the "compact" * view mode. - * - metadata: Metadata for this node. * - date: (optional) Themed creation date field. * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. diff --git a/core/themes/claro/templates/classy/content/node.html.twig b/core/themes/claro/templates/classy/content/node.html.twig index 34e9cf921e0..710c62ec968 100644 --- a/core/themes/claro/templates/classy/content/node.html.twig +++ b/core/themes/claro/templates/classy/content/node.html.twig @@ -22,7 +22,6 @@ * of a given child element. * - author_picture: The node author user entity, rendered using the "compact" * view mode. - * - metadata: Metadata for this node. * - date: (optional) Themed creation date field. * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. diff --git a/core/themes/olivero/templates/content/node--teaser.html.twig b/core/themes/olivero/templates/content/node--teaser.html.twig index b641705881b..40a2c51e4a2 100644 --- a/core/themes/olivero/templates/content/node--teaser.html.twig +++ b/core/themes/olivero/templates/content/node--teaser.html.twig @@ -22,7 +22,6 @@ * of a given child element. * - author_picture: The node author user entity, rendered using the "compact" * view mode. - * - metadata: Metadata for this node. * - date: (optional) Themed creation date field. * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. diff --git a/core/themes/olivero/templates/content/node.html.twig b/core/themes/olivero/templates/content/node.html.twig index 9c45bdf2d9d..4af6e2ffb53 100644 --- a/core/themes/olivero/templates/content/node.html.twig +++ b/core/themes/olivero/templates/content/node.html.twig @@ -22,7 +22,6 @@ * of a given child element. * - author_picture: The node author user entity, rendered using the "compact" * view mode. - * - metadata: Metadata for this node. * - date: (optional) Themed creation date field. * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. diff --git a/core/themes/stable9/templates/content/node.html.twig b/core/themes/stable9/templates/content/node.html.twig index 9f4648a1ab9..e73d76e651f 100644 --- a/core/themes/stable9/templates/content/node.html.twig +++ b/core/themes/stable9/templates/content/node.html.twig @@ -22,7 +22,6 @@ * of a given child element. * - author_picture: The node author user entity, rendered using the "compact" * view mode. - * - metadata: Metadata for this node. * - date: (optional) Themed creation date field. * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node. diff --git a/core/themes/starterkit_theme/templates/content/node.html.twig b/core/themes/starterkit_theme/templates/content/node.html.twig index 1abb091f71f..c620305f6c4 100644 --- a/core/themes/starterkit_theme/templates/content/node.html.twig +++ b/core/themes/starterkit_theme/templates/content/node.html.twig @@ -22,7 +22,6 @@ * of a given child element. * - author_picture: The node author user entity, rendered using the "compact" * view mode. - * - metadata: Metadata for this node. * - date: (optional) Themed creation date field. * - author_name: (optional) Themed author name field. * - url: Direct URL of the current node.