Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dynac01 committed Jul 25, 2024
1 parent 0384099 commit 4745cbb
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/Plugin/dgi_migrate_alter/spreadsheet/DssiNodeAlter.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ public function alter(array &$migration): void {
['field_origin_information', 'field_issuance', 'issuance', '^'],
['field_origin_information', 'field_frequency', 'frequency', '^'],
];
$expected_child_fields = [
'field_event_type', 'field_place', 'field_date_created',
'field_date_issued', 'field_date_captured', 'field_date_valid', 'field_date_modified',
'field_other_date', 'field_copyright_date', 'field_publisher', 'field_edition',
'field_issuance', 'field_frequency',
];

foreach ($tetiary_delimiter_fields_to_add as $field) {
[
Expand All @@ -92,14 +86,10 @@ public function alter(array &$migration): void {
$delimiter,
] = $field;

// Ensure that the keys in 'values' are a subset of $allowed_child_fields.
$values_keys = array_keys($process[$parent_field][2]['values']);
$is_subset = !array_diff($values_keys, $expected_child_fields);
\assert(
$is_subset,
'Keys in $process['
. $parent_field . '][2][\'values\'] are not a subset of allowed child fields: '
. \json_encode($values_keys, JSON_THROW_ON_ERROR)
$process[$parent_field][2]['plugin'] === 'dgi_paragraph_generate',
'dgi_migrate.process.explode is not the correct plugin for '
. json_encode($process[$parent_field][2], JSON_THROW_ON_ERROR)
);

// Continue with overwrite.
Expand Down

0 comments on commit 4745cbb

Please sign in to comment.