From f2a537be0a0763c39001d8b93904a481bd439c0e Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 15 Jul 2024 12:26:42 +0200 Subject: [PATCH] fix TypeError array_merge() parameter #1 must be of type array, string given --- api/src/Etemplate/Widget/Link.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Etemplate/Widget/Link.php b/api/src/Etemplate/Widget/Link.php index 4db57a3b1d..be99431a36 100644 --- a/api/src/Etemplate/Widget/Link.php +++ b/api/src/Etemplate/Widget/Link.php @@ -416,9 +416,9 @@ class Link extends Etemplate\Widget } // Link widgets can share IDs, make sure to preserve values from others $already = self::get_array($validated, $form_name, false, true); - if($already != null) + if(!empty($already) && $already != $value) { - $value = array_merge((array)$value, (already)$already); + $value = array_merge((array)$value, (array)$already); } // Automatically do link if user selected entry but didn't click 'Link' button $link = self::get_array($content, self::form_name($cname, $this->id . '_link_entry'));