Skip to content

Commit

Permalink
Make all newsroom items published by default. Reset empty results fro…
Browse files Browse the repository at this point in the history
…m the feed.
  • Loading branch information
LOBsTerr committed Jun 22, 2021
1 parent 8284584 commit ae8d179
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ process:
plugin: get
source: published_date

status:
plugin: default_value
default_value: 1

destination:
plugin: entity:node

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ function newsroom_connector_item_migrate_prepare_row(
}

if ($migration->id() == 'newsroom_item') {
// We set empty string for fields, which don't have values. So, they will be reset.
$source_fields = $row->getSource()['fields'];
foreach ($source_fields as $source_field) {
$source_field_name = $source_field['name'];
$source_field_value = $row->getSourceProperty($source_field_name);
if (empty($source_field_value)) {
$row->setSourceProperty($source_field_name, '');
}
}

// Convert the date to timestamp, to get a correct date
// we need to clean UTC.
Expand Down

0 comments on commit ae8d179

Please sign in to comment.