Skip to content

Commit

Permalink
LOYALIST-58 Migrate body field using subprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Jul 11, 2024
1 parent f2f54b0 commit cafd21c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,24 @@ process:
bundle_key: vid
bundle: subject_heading
value_key: name
field_other_numbers/value: field_other_numbers_value
field_other_numbers/format:
plugin: default_value
default_value: 'wysiwyg'
body/value: body
body/format:
plugin: default_value
default_value: 'wysiwyg'
field_other_numbers:
-
plugin: sub_process
source: field_other_numbers_value
process:
value: value
format:
plugin: default_value
default_value: wysiwyg
body:
-
plugin: sub_process
source: body
process:
value: value
format:
plugin: default_value
default_value: wysiwyg

destination:
plugin: 'entity:node'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function query()

$query->leftJoin('field_data_field_other_numbers', 'fon', 'n.nid = fon.entity_id AND fon.deleted = 0');
$query->addField('fon', 'field_other_numbers_value', 'field_other_numbers_value');
$query->addField('fon', 'field_other_numbers_format', 'field_other_numbers_format');

$query->leftJoin('field_data_field_issuing_body', 'fib', 'n.nid = fib.entity_id AND fib.deleted = 0');
$query->leftJoin('taxonomy_term_data', 'ttdfib', 'fib.field_issuing_body_tid = ttdfib.tid');
Expand All @@ -57,13 +56,12 @@ public function fields()
{
// This maps the field from their name above to a destination field name that is specified in the process section. I generally keep them the same.
$fields = [
'title' => 'title',
'nid' => 'nid',
'title' => 'title',
'field_accompanying_record_value' => 'field_accompanying_record_value',
'issuing_body_name' => 'issuing_body_name',
'subject_heading_name' => 'subject_heading_name',
'field_other_numbers_value' => 'field_other_numbers_value',
'field_other_numbers_format' => 'field_other_numbers_format',
'body' => 'body',
];
return $fields;
Expand Down

0 comments on commit cafd21c

Please sign in to comment.