From add6326dc97fc360206981ea3c3fa2e641c8c000 Mon Sep 17 00:00:00 2001 From: Jeroen Dalsem Date: Tue, 28 Sep 2021 11:05:40 +0200 Subject: [PATCH] fixed: check for array when saving settings fixes #124 --- classes/ColdTrick/WidgetManager/Settings.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/ColdTrick/WidgetManager/Settings.php b/classes/ColdTrick/WidgetManager/Settings.php index e131c5e..f754085 100644 --- a/classes/ColdTrick/WidgetManager/Settings.php +++ b/classes/ColdTrick/WidgetManager/Settings.php @@ -23,6 +23,11 @@ public static function implodeSettings(\Elgg\Hook $hook) { return; } - return implode(',', $hook->getValue()); + $current_value = $hook->getValue(); + if (!is_array($current_value)) { + return; + } + + return implode(',', $current_value); } }