From 9edde1a6a958975f6a9da156aaf6f6cb7af08bee Mon Sep 17 00:00:00 2001 From: thiemen Date: Sun, 14 Jul 2019 14:49:02 +1200 Subject: [PATCH] PATCH: typo --- code/Model/SalesforceDefaultContactField.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/Model/SalesforceDefaultContactField.php b/code/Model/SalesforceDefaultContactField.php index 19952de..5277fad 100644 --- a/code/Model/SalesforceDefaultContactField.php +++ b/code/Model/SalesforceDefaultContactField.php @@ -75,8 +75,6 @@ public function getTitle() public function requireDefaultRecords() { foreach ($this->Config()->get('default_records') as $key => $details) { - $value = isset($details['Value']) ? $details['Value'] : 'please set'; - $type = isset($details['ValueType']) ? $details['ValueType'] : 'String'; $filter = [ 'Key' => $key, ]; @@ -84,6 +82,10 @@ public function requireDefaultRecords() $obj = self::get()->filter($filter)->first(); if (! $obj) { $obj = self::create($filter); + // get values + $value = isset($details['Value']) ? $details['Value'] : 'please set'; + $type = isset($details['ValueType']) ? $details['ValueType'] : 'String'; + // set values $obj->Value = $value; $obj->ValueType = $type; $obj->write();