From 6de258730be7ab24b766b3d5ce526743068c631a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 26 Apr 2017 15:31:24 +0200 Subject: [PATCH] Sync: fix issues with PHP 5.3 Problem has been introduced with f885d90 fixes #906 --- library/Director/Import/Sync.php | 6 ++++-- library/Director/Import/SyncUtils.php | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/library/Director/Import/Sync.php b/library/Director/Import/Sync.php index db6bbd43..ae42789e 100644 --- a/library/Director/Import/Sync.php +++ b/library/Director/Import/Sync.php @@ -268,8 +268,10 @@ class Sync $filterColumns[$column] = $column; } } - foreach (SyncUtils::getRootVariables($filterColumns) as $column) { - $usedColumns[$column] = $column; + if (! empty($filterColumns)) { + foreach (SyncUtils::getRootVariables($filterColumns) as $column) { + $usedColumns[$column] = $column; + } } $rows = $run->fetchRows($usedColumns); diff --git a/library/Director/Import/SyncUtils.php b/library/Director/Import/SyncUtils.php index 8ec31da5..c57d11c6 100644 --- a/library/Director/Import/SyncUtils.php +++ b/library/Director/Import/SyncUtils.php @@ -125,6 +125,10 @@ class SyncUtils } } + if (empty($res)) { + return array(); + } + return array_combine($res, $res); } }