Commit 790e1e46 authored by Chris Shantz's avatar Chris Shantz
Browse files

Merge branch '1.0.x' into prod/1.0.x

parents 69bc33b3 d3d6fe27
......@@ -44,6 +44,7 @@ process:
uw_ct_web_page: {}
uw_ct_opportunity: {}
uw_ct_service: {}
uw_ct_project: {}
- plugin: uw_dom_inline_image_handler
- plugin: uw_dom_inline_file_handler
- plugin: dom
......@@ -68,3 +69,4 @@ migration_dependencies:
- uw_ct_web_page
- uw_ct_opportunity
- uw_ct_service
- uw_ct_project
......@@ -28,6 +28,13 @@ process:
migration: uw_mt_image
source: fid
no_stub: true
field_uw_type_of_gallery:
plugin: static_map
source: gallery_type
map:
Carousel: slider
Thumbnails: grid
default_value: slider
destination:
plugin: entity:block_content
default_bundle: uw_cbl_image_gallery
......
......@@ -45,3 +45,4 @@ migration_dependencies:
- uw_ct_web_page
- uw_ct_opportunity
- uw_ct_service
- uw_ct_project
......@@ -32,6 +32,7 @@ process:
uw_ct_profile: {}
uw_ct_web_page: {}
uw_ct_service: {}
uw_ct_project: {}
- plugin: uw_dom_inline_image_handler
- plugin: dom
method: export
......@@ -54,3 +55,4 @@ migration_dependencies:
- uw_ct_site_footer
- uw_ct_web_page
- uw_ct_service
- uw_ct_project
......@@ -21,6 +21,7 @@ source:
- field_profile_photo
- field_uw_image_gallery_images
- field_image_opportunities
- field_project_image
properties:
- alt
- title
......
......@@ -24,11 +24,11 @@ process:
migration: uw_mt_image
source: field_profile_photo/0/fid
no_stub: true
field_uw_ct_profile_contact:
plugin: migration_lookup
migration: uw_ct_contact
source: field_contact_information
no_stub: true
field_uw_ct_profile_link_contact:
- plugin: migration_lookup
migration: uw_ct_contact
source: field_contact_information
- plugin: uw_contact_link
field_uw_ct_profile_type:
plugin: migration_lookup
migration: uw_taxonomy_term
......
id: uw_ct_project
label: Project
migration_group: uw
audit: true
migration_tags:
- Drupal 7
- Content
- Node
source:
plugin: uw_node
node_type: uw_project
batch_size: 200
process:
title: title
field_uw_project_listing_image:
plugin: migration_lookup
migration: uw_mt_image
source: field_project_image/0/fid
no_stub: true
pseudo_field_uw_project_members:
plugin: sub_process
source: field_project_leaderrole
process:
paragraph:
plugin: migration_lookup
migration: uw_para_project_members
source: value
field_uw_project_members:
plugin: sub_process
source: '@pseudo_field_uw_project_members'
process:
target_id: paragraph/0
target_revision_id: paragraph/1
field_uw_project_timeline:
plugin: uw_smartdate
source: field_project_date
field_uw_project_status:
plugin: migration_lookup
migration: uw_taxonomy_term
source: field_project_status
no_stub: true
field_uw_audience:
plugin: sub_process
source: field_project_audience
process:
target_id:
plugin: migration_lookup
migration: uw_taxonomy_term
source: tid
no_stub: true
field_uw_project_topics:
plugin: sub_process
source: field_project_topic
process:
target_id:
plugin: migration_lookup
migration: uw_taxonomy_term
source: tid
no_stub: true
field_uw_project_summary:
plugin: uw_summary
trimmed: true
source: field_project_description
field_uw_meta_description:
plugin: uw_summary
trimmed: true
source: field_project_description
uid:
- plugin: migration_lookup
migration: uw_user
source: node_uid
no_stub: true
- plugin: default_value
default_value: 0
langcode:
plugin: default_value
source: language
default_value: "und"
status: status
moderation_state:
plugin: static_map
source: status
map:
'0': draft
'1': published
default_value: draft
created: created
changed: changed
promote: promote
sticky: sticky
revision_uid:
- plugin: migration_lookup
migration: uw_user
source: revision_uid
no_stub: true
- plugin: default_value
default_value: 0
revision_log: log
revision_timestamp: timestamp
field_uw_meta_tags:
plugin: d7_metatag_entities
source: pseudo_metatag_entities
destination:
plugin: entity:node
default_bundle: uw_ct_project
migration_dependencies:
required:
- uw_user
- uw_taxonomy_term
optional:
- uw_mt_image
- uw_para_project_members
- uw_ct_contact
- uw_ct_profile
......@@ -77,3 +77,4 @@ migration_dependencies:
- uw_ct_web_page
- uw_ct_opportunity
- uw_ct_service
- uw_ct_project
......@@ -36,3 +36,4 @@ migration_dependencies:
- uw_ct_web_page
- uw_ct_opportunity
- uw_ct_service
- uw_ct_project
id: uw_para_project_members
label: 'Project members paragraphs'
migration_tags:
- Drupal 7
- Content
- Paragraph
migration_group: uw
source:
plugin: uw_field_collection_item
field_name: field_project_leaderrole
process:
field_uw_project_name: field_project_name/0/title
field_uw_project_members_link:
- plugin: skip_on_empty
method: process
source: field_project_name/0/url
- plugin: uw_migration_lookup_path
source: field_project_name
- plugin: field_link
uri_scheme: https://
field_uw_project_role:
plugin: migration_lookup
migration: uw_taxonomy_term
source: field_project_roles
no_stub: true
destination:
plugin: entity_reference_revisions:paragraph
default_bundle: uw_para_project_members
migration_dependencies:
optional:
- uw_taxonomy_term
- uw_ct_contact
- uw_ct_profile
......@@ -51,3 +51,4 @@ migration_dependencies:
- uw_ct_web_page
- uw_ct_opportunity
- uw_ct_service
- uw_ct_project
......@@ -69,3 +69,4 @@ migration_dependencies:
- uw_ct_web_page
- uw_ct_opportunity
- uw_ct_service
- uw_ct_project
......@@ -34,6 +34,7 @@ process:
- uw_ct_web_page
- uw_ct_opportunity
- uw_ct_service
- uw_ct_project
- plugin: extract
index:
- 0
......@@ -57,3 +58,4 @@ migration_dependencies:
- uw_ct_web_page
- uw_ct_opportunity
- uw_ct_service
- uw_ct_project
......@@ -19,6 +19,9 @@ source:
- uw_event_type
- uwaterloo_audience
- service_categories
- project_status
- project_role
- project_topic
process:
vid:
plugin: static_map
......@@ -35,6 +38,9 @@ process:
uwaterloo_faculties: uw_vocab_faculties_and_schools
uwaterloo_audience: uw_vocab_audience
service_categories: uw_vocab_service_categories
project_status: uw_vocab_project_status
project_role: uw_vocab_project_role
project_topic: uw_vocab_project_topic
tid:
plugin: uw_taxonomy_term_lookup
source:
......
......@@ -42,6 +42,7 @@ process:
- uw_ct_web_page
- uw_ct_opportunity
- uw_ct_service
- uw_ct_project
no_stub: true
-
plugin: skip_on_empty
......@@ -71,3 +72,4 @@ migration_dependencies:
- uw_ct_web_page
- uw_ct_opportunity
- uw_ct_service
- uw_ct_project
......@@ -47,6 +47,7 @@ class UwContentFieldsDeriver extends DeriverBase implements ContainerDeriverInte
'field_image_gallery_bottom',
'field_sidebar_content',
'field_position_description',
'field_project_description',
];
foreach ($fields as $field_name) {
......
......@@ -79,6 +79,11 @@ class UwLayoutBuilderDeriver extends DeriverBase implements ContainerDeriverInte
'uw_ct_opportunity',
],
],
'field_project_description' => [
'content_migrations' => [
'uw_ct_project',
],
],
];
foreach ($fields as $field_name => $data) {
......
<?php
namespace Drupal\uw_migrate\Plugin\migrate\process;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
/**
* Creates a link from entity reference.
*
* @code
* process:
* destination_field:
* plugin: uw_contact_link
* source: source_field
* @endcode
*
* @MigrateProcessPlugin(
* id = "uw_contact_link"
* )
*/
class UwContactLink extends ProcessPluginBase {
/**
* {@inheritDoc}
*/
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
if ($value) {
$value = 'entity:node/' . $value;
}
return $value;
}
}
......@@ -36,6 +36,7 @@ class UwNodeLookup extends MigrationLookup {
'uw_ct_opportunity',
'uw_ct_profile',
'uw_ct_service',
'uw_ct_project',
'uw_ct_site_footer',
'uw_ct_web_page',
];
......
......@@ -36,14 +36,15 @@ class UwSmartDate extends ProcessPluginBase {
$prev_item = NULL;
foreach ($value as $item) {
$start_value = new DrupalDateTime($item['value'], $item['timezone']);
$end_value = new DrupalDateTime($item['value2'], $item['timezone']);
$timezone = $item['timezone'] ?? 'America/Toronto';
$start_value = new DrupalDateTime($item['value'], $timezone);
$end_value = new DrupalDateTime($item['value2'], $timezone);
$new_item = [
'value' => $start_value->getTimestamp(),
'end_value' => $end_value->getTimestamp(),
'duration' => (int) ($end_value->getTimestamp() - $start_value->getTimestamp()) / 60,
'timezone' => $item['timezone'],
'timezone' => $timezone,
];
if (empty($item['rrule'])) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment