From a7f11f7702d0742056a3d474b33c1b17d3212976 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 3 Dec 2015 00:39:46 +0100 Subject: [PATCH] ImportSourceHook: add failsafe getSetting method --- library/Director/Import/Sync.php | 1 - library/Director/Web/Hook/ImportSourceHook.php | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/library/Director/Import/Sync.php b/library/Director/Import/Sync.php index c0579b35..3e129eb7 100644 --- a/library/Director/Import/Sync.php +++ b/library/Director/Import/Sync.php @@ -301,7 +301,6 @@ class Sync if ($object->hasBeenModified()) { $object->store($db); } - } $dba->commit(); diff --git a/library/Director/Web/Hook/ImportSourceHook.php b/library/Director/Web/Hook/ImportSourceHook.php index b6f2a9f1..b834ff2e 100644 --- a/library/Director/Web/Hook/ImportSourceHook.php +++ b/library/Director/Web/Hook/ImportSourceHook.php @@ -64,6 +64,14 @@ abstract class ImportSourceHook return $this; } + public function getSetting($name, $default = null) { + if (array_key_exists($name, $this->settings)) { + return $this->settings[$name]; + } else { + return $default; + } + } + /** * Returns an array containing importable objects *