From c2a23a9e5ba3cb6e085340ca8d1b2f8e61cb05a9 Mon Sep 17 00:00:00 2001 From: bach Date: Mon, 15 Feb 2021 12:41:33 +0100 Subject: [PATCH] migration: cutting nosample location to memo #nosample --- .../src/Plugin/migrate/source/D7NodeMateriau.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web/modules/custom/materio_migrate/src/Plugin/migrate/source/D7NodeMateriau.php b/web/modules/custom/materio_migrate/src/Plugin/migrate/source/D7NodeMateriau.php index 4e4e051..3044fe1 100644 --- a/web/modules/custom/materio_migrate/src/Plugin/migrate/source/D7NodeMateriau.php +++ b/web/modules/custom/materio_migrate/src/Plugin/migrate/source/D7NodeMateriau.php @@ -166,6 +166,19 @@ class D7NodeMateriau extends FieldableEntity { } } + //location (samples) + $locations = []; + if(!empty($row->getSourceProperty('field_location'))){ + foreach ($row->getSourceProperty('field_location') as $key => $value) { + if ($value['location'] == 'no sample') { + $memo .= "#nosample (".$value["showroom_tid"].")\n"; + }else{ + $locations[] = $value; + } + } + } + $row->setSourceProperty('field_location', $locations); + // workflow $query = $this->select('workflow_node', 'wn'); $query->fields('wn', ['sid']);