From 039e2c0d13236ed1e1de8c92b8e7c10a22d13d0e Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Fri, 19 Apr 2024 13:47:10 +0300 Subject: [PATCH] UHF-9704: Fix article_modified_time metatag --- .../config/rewrite/metatag.metatag_defaults.node.yml | 2 +- modules/helfi_base_content/helfi_base_content.install | 8 ++++++++ .../install/metatag.metatag_defaults.tpr_service.yml | 2 +- .../config/install/metatag.metatag_defaults.tpr_unit.yml | 2 +- modules/helfi_tpr_config/helfi_tpr_config.install | 8 ++++++++ 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/modules/helfi_base_content/config/rewrite/metatag.metatag_defaults.node.yml b/modules/helfi_base_content/config/rewrite/metatag.metatag_defaults.node.yml index 816c6db7a..03eebd1a4 100644 --- a/modules/helfi_base_content/config/rewrite/metatag.metatag_defaults.node.yml +++ b/modules/helfi_base_content/config/rewrite/metatag.metatag_defaults.node.yml @@ -7,7 +7,7 @@ tags: title: '[node:title] | [site:page-title-suffix]' description: '[node:lead-in]' canonical_url: '[node:url]' - article_modified_time: '[node:created:html_datetime]' + article_modified_time: '[node:changed:html_datetime]' article_published_time: '[node:created:html_datetime]' content_language: '[node:langcode]' og_title: '[node:title]' diff --git a/modules/helfi_base_content/helfi_base_content.install b/modules/helfi_base_content/helfi_base_content.install index d3e06edb7..a25784a76 100644 --- a/modules/helfi_base_content/helfi_base_content.install +++ b/modules/helfi_base_content/helfi_base_content.install @@ -318,3 +318,11 @@ function helfi_base_content_update_9011(): void { $role->revokePermission('assign admin role'); $role->save(); } + +/** + * UHF-9704 Fix article_modified_time metatag. + */ +function helfi_base_content_update_9012(): void { + \Drupal::service('helfi_platform_config.config_update_helper') + ->update('helfi_base_content'); +} diff --git a/modules/helfi_tpr_config/config/install/metatag.metatag_defaults.tpr_service.yml b/modules/helfi_tpr_config/config/install/metatag.metatag_defaults.tpr_service.yml index 2e5365f7b..2729b80c6 100644 --- a/modules/helfi_tpr_config/config/install/metatag.metatag_defaults.tpr_service.yml +++ b/modules/helfi_tpr_config/config/install/metatag.metatag_defaults.tpr_service.yml @@ -9,7 +9,7 @@ tags: content_language: '[tpr_service:langcode]' description: '[tpr_service:description:summary]' title: '[tpr_service:label] | [site:page-title-suffix]' - article_modified_time: '[tpr_service:created:html_datetime]' + article_modified_time: '[tpr_service:changed:html_datetime]' article_published_time: '[tpr_service:created:html_datetime]' og_title: '[tpr_service:label]' og_description: '[tpr_service:description:summary]' diff --git a/modules/helfi_tpr_config/config/install/metatag.metatag_defaults.tpr_unit.yml b/modules/helfi_tpr_config/config/install/metatag.metatag_defaults.tpr_unit.yml index 88a965fc6..71a11af33 100644 --- a/modules/helfi_tpr_config/config/install/metatag.metatag_defaults.tpr_unit.yml +++ b/modules/helfi_tpr_config/config/install/metatag.metatag_defaults.tpr_unit.yml @@ -9,7 +9,7 @@ tags: content_language: '[tpr_unit:langcode]' description: '[tpr_unit:description:summary]' title: '[tpr_unit:label] | [site:page-title-suffix]' - article_modified_time: '[tpr_unit:created:html_datetime]' + article_modified_time: '[tpr_unit:changed:html_datetime]' article_published_time: '[tpr_unit:created:html_datetime]' og_description: '[tpr_unit:description:summary]' og_email: '[tpr_unit:email]' diff --git a/modules/helfi_tpr_config/helfi_tpr_config.install b/modules/helfi_tpr_config/helfi_tpr_config.install index ddd1091c1..e32209d3a 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.install +++ b/modules/helfi_tpr_config/helfi_tpr_config.install @@ -406,3 +406,11 @@ function helfi_tpr_config_update_9064(): void { \Drupal::service('helfi_platform_config.config_update_helper') ->update('helfi_tpr_config'); } + +/** + * UHF-9704 Fix article_modified_time metatag. + */ +function helfi_tpr_config_update_9065(): void { + \Drupal::service('helfi_platform_config.config_update_helper') + ->update('helfi_tpr_config'); +}