From 6e5c21d17f524f4bc7c712fd185c846fd237a204 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Wed, 29 Mar 2023 10:30:21 -0700 Subject: [PATCH] Closes #2264 Migrate path aliases for nodes if they exist, otherwise turn on Pathauto. (#2281) Co-authored-by: Joe Parsons <471936+joeparsons@users.noreply.github.com> --- .../migrations/az_node_carousel.yml | 25 +++++++++--------- .../az_migration/migrations/az_node_event.yml | 24 ++++++++++------- .../migrations/az_node_flexible_page.yml | 26 +++++++++---------- .../az_migration/migrations/az_node_news.yml | 25 +++++++++--------- .../migrations/az_node_person.yml | 26 +++++++++---------- .../az_node_uaqs_basic_page_to_az_page.yml | 26 +++++++++---------- 6 files changed, 79 insertions(+), 73 deletions(-) diff --git a/modules/custom/az_migration/migrations/az_node_carousel.yml b/modules/custom/az_migration/migrations/az_node_carousel.yml index 6f311e1049..938cdcfb2c 100644 --- a/modules/custom/az_migration/migrations/az_node_carousel.yml +++ b/modules/custom/az_migration/migrations/az_node_carousel.yml @@ -95,18 +95,19 @@ process: changed: changed promote: promote sticky: sticky - path/pathauto: - - - plugin: skip_on_empty + - plugin: str_replace source: alias - method: process - - - plugin: default_value - default_value: 0 - - path/alias: - - - plugin: skip_on_empty + regex: true + search: /.$/ + replace: 0 + - plugin: default_value source: alias - method: process + default_value: 1 + strict: true + - plugin: callback + callable: intval + path/alias: + plugin: skip_on_empty + source: alias + method: process diff --git a/modules/custom/az_migration/migrations/az_node_event.yml b/modules/custom/az_migration/migrations/az_node_event.yml index 94ca148df4..b6d2b8000e 100644 --- a/modules/custom/az_migration/migrations/az_node_event.yml +++ b/modules/custom/az_migration/migrations/az_node_event.yml @@ -189,18 +189,22 @@ process: changed: changed promote: promote sticky: sticky - path/pathauto: - - - plugin: skip_on_empty + - plugin: str_replace source: alias - method: process - - - plugin: default_value - default_value: 0 - - path/alias: alias - + regex: true + search: /.$/ + replace: 0 + - plugin: default_value + source: alias + default_value: 1 + strict: true + - plugin: callback + callable: intval + path/alias: + plugin: skip_on_empty + source: alias + method: process field_az_event_category: - plugin: migration_lookup diff --git a/modules/custom/az_migration/migrations/az_node_flexible_page.yml b/modules/custom/az_migration/migrations/az_node_flexible_page.yml index d02af44f83..4a0c1da564 100644 --- a/modules/custom/az_migration/migrations/az_node_flexible_page.yml +++ b/modules/custom/az_migration/migrations/az_node_flexible_page.yml @@ -67,22 +67,22 @@ process: changed: changed promote: promote sticky: sticky - path/pathauto: - - - plugin: skip_on_empty + - plugin: str_replace source: alias - method: process - - - plugin: default_value - default_value: 0 - - path/alias: - - - plugin: skip_on_empty + regex: true + search: /.$/ + replace: 0 + - plugin: default_value source: alias - method: process - + default_value: 1 + strict: true + - plugin: callback + callable: intval + path/alias: + plugin: skip_on_empty + source: alias + method: process field_az_page_category: - plugin: migration_lookup diff --git a/modules/custom/az_migration/migrations/az_node_news.yml b/modules/custom/az_migration/migrations/az_node_news.yml index fa69eb8a96..7d65828147 100644 --- a/modules/custom/az_migration/migrations/az_node_news.yml +++ b/modules/custom/az_migration/migrations/az_node_news.yml @@ -283,18 +283,19 @@ process: changed: changed promote: promote sticky: sticky - path/pathauto: - - - plugin: skip_on_empty + - plugin: str_replace source: alias - method: process - - - plugin: default_value - default_value: 0 - - path/alias: - - - plugin: skip_on_empty + regex: true + search: /.$/ + replace: 0 + - plugin: default_value source: alias - method: process + default_value: 1 + strict: true + - plugin: callback + callable: intval + path/alias: + plugin: skip_on_empty + source: alias + method: process diff --git a/modules/custom/az_migration/migrations/az_node_person.yml b/modules/custom/az_migration/migrations/az_node_person.yml index a19f619b09..737fcb6d15 100644 --- a/modules/custom/az_migration/migrations/az_node_person.yml +++ b/modules/custom/az_migration/migrations/az_node_person.yml @@ -181,22 +181,22 @@ process: changed: changed promote: promote sticky: sticky - path/pathauto: - - - plugin: skip_on_empty + - plugin: str_replace source: alias - method: process - - - plugin: default_value - default_value: 0 - - path/alias: - - - plugin: skip_on_empty + regex: true + search: /.$/ + replace: 0 + - plugin: default_value source: alias - method: process - + default_value: 1 + strict: true + - plugin: callback + callable: intval + path/alias: + plugin: skip_on_empty + source: alias + method: process field_az_person_category: - plugin: migration_lookup diff --git a/modules/custom/az_migration/migrations/az_node_uaqs_basic_page_to_az_page.yml b/modules/custom/az_migration/migrations/az_node_uaqs_basic_page_to_az_page.yml index bbc9c880db..32cc75d396 100644 --- a/modules/custom/az_migration/migrations/az_node_uaqs_basic_page_to_az_page.yml +++ b/modules/custom/az_migration/migrations/az_node_uaqs_basic_page_to_az_page.yml @@ -40,22 +40,22 @@ process: changed: changed promote: promote sticky: sticky - path/pathauto: - - - plugin: skip_on_empty + - plugin: str_replace source: alias - method: process - - - plugin: default_value - default_value: 0 - - path/alias: - - - plugin: skip_on_empty + regex: true + search: /.$/ + replace: 0 + - plugin: default_value source: alias - method: process - + default_value: 1 + strict: true + - plugin: callback + callable: intval + path/alias: + plugin: skip_on_empty + source: alias + method: process field_az_main_content/target_id: - plugin: migration_lookup