From c9e5f16d3eeb65591a9a0a50e65393fef40f8c77 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 26 Jul 2015 15:38:29 +0200 Subject: [PATCH] Import: exception for missing key column... ...but skip check for now --- library/Director/Import/Import.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/Director/Import/Import.php b/library/Director/Import/Import.php index f2bd88fc..da0fb0ff 100644 --- a/library/Director/Import/Import.php +++ b/library/Director/Import/Import.php @@ -32,8 +32,16 @@ class Import foreach (ImportSourceHook::loadByName($source->source_name, $connection)->fetchData() as $row) { // TODO: Check for name collision if (! isset($row->$keyColumn)) { - die('Depp'); +continue; + throw new \Exception( + sprintf( + 'No key column "%s" in row: %s', + $keyColumn, + json_encode($row) + ) + ); } + $object_name = $row->$keyColumn; $rowChecksums = array(); $keys = array_keys((array) $row);