partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit ffcbaed4cca213f1f709528b9e2c2d2f2a3e42a1
parent 90662ad1522715eef1fcfe94a4d08055c25207ba
Author: Felicia Hummel <felicia@partkeepr.com>
Date:   Fri, 10 Feb 2017 10:36:51 +0100

Check if the selected import column exists, related to #812

Diffstat:
Msrc/PartKeepr/ImportBundle/Configuration/FieldConfiguration.php | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/PartKeepr/ImportBundle/Configuration/FieldConfiguration.php b/src/PartKeepr/ImportBundle/Configuration/FieldConfiguration.php @@ -79,6 +79,10 @@ class FieldConfiguration extends BaseConfiguration return $this->fixedValue; break; case self::FIELDCONFIGURATION_COPYFROM: + if (!array_key_exists($this->copyFromField, $row)) { + $this->log(sprintf("Error: Column %s for %s does not exist", $this->copyFromField, $this->fieldName)); + return null; + } $this->log(sprintf("Would set field %s to value %s (import column %s)", $this->fieldName, $row[$this->copyFromField], $this->copyFromField)); return $row[$this->copyFromField];