diff --git a/modules/custom/az_news/az_news_feeds/config/install/migrate_plus.migration.az_news_feed_stories.yml b/modules/custom/az_news/az_news_feeds/config/install/migrate_plus.migration.az_news_feed_stories.yml index b913adeaf7..80bcb6b1e1 100644 --- a/modules/custom/az_news/az_news_feeds/config/install/migrate_plus.migration.az_news_feed_stories.yml +++ b/modules/custom/az_news/az_news_feeds/config/install/migrate_plus.migration.az_news_feed_stories.yml @@ -18,6 +18,9 @@ source: ids: uuid: type: uuid + constants: + read_more_prefix: 'Read more at ' + read_more_default_publisher: 'University of Arizona News' fields: - name: uuid @@ -55,6 +58,14 @@ source: name: image label: Image selector: /story/img-large + - + name: byline + label: Byline + selector: /story/byline + - + name: byline-affiliation + label: 'Byline Affiliation' + selector: /story/byline-affiliation process: title: title field_az_published/value: @@ -62,10 +73,41 @@ process: from_format: 'Y-m-d\TH:i:sP' to_format: Y-m-d source: date-of-publication - field_az_link/uri: canonical-url - field_az_link/title: - plugin: default_value - default_value: 'Read more at University of Arizona News' + _default_byline: + - + plugin: callback + callable: strpos + unpack_source: true + source: + - canonical-url + - 'https://news.arizona.edu/' + - + plugin: callback + callable: strpos + unpack_source: true + source: + - canonical-url + - 'ua-news-redesign.pantheonsite.io/' + - + plugin: skip_on_empty + method: process + - + plugin: concat + source: + - constants/read_more_prefix + - byline-affiliation + _byline_from_link_title: + - + plugin: skip_on_empty + source: byline-affiliation + method: process + field_az_link/0/uri: canonical-url + field_az_link/0/title: + - + plugin: null_coalesce + source: + - '@_default_byline' + - '@_byline_from_link_title' field_az_summary/value: plugin: callback callable: trim