From 0a00e1aa7d2a35035054ddb4189156465f4780d8 Mon Sep 17 00:00:00 2001 From: signalwerk Date: Mon, 20 Sep 2021 23:21:10 +0200 Subject: [PATCH] ADD support to import reference by ID --- Classes/Controller/ImportController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Classes/Controller/ImportController.php b/Classes/Controller/ImportController.php index f7bfa6d..24f1036 100644 --- a/Classes/Controller/ImportController.php +++ b/Classes/Controller/ImportController.php @@ -130,7 +130,12 @@ public function importAction() { $i = 0; foreach ($row as $col) { if (isset($mapping[$i]) && $mapping[$i] != '___') { - $node->setProperty($mapping[$i], $col); + if ($node->getNodeType()->getPropertyType($mapping[$i]) === 'reference') { + $refNode = $q->find($col)->get(0); + $node->setProperty($mapping[$i], $refNode); + } else { + $node->setProperty($mapping[$i], $col); + } } $i++; }