From 1332031f3dde0f02de9dd767a3c2c067064a7f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikke=20Schir=C3=A9n?= Date: Wed, 18 Dec 2024 23:29:41 +0100 Subject: [PATCH 1/2] check if value exists for using it --- plugins/SitesManager/API.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/SitesManager/API.php b/plugins/SitesManager/API.php index 9f09c194b3b..f25c1ace26e 100644 --- a/plugins/SitesManager/API.php +++ b/plugins/SitesManager/API.php @@ -807,9 +807,11 @@ private function setSettingValue($fieldName, $value, $coreProperties, $settingVa if (empty($coreProperties[$pluginName])) { $coreProperties[$pluginName] = []; } + if (isset($setting['value'])){ + $coreProperties[$pluginName][] = ['name' => $fieldName, 'value' => $setting['value']]; + return $coreProperties; + } - $coreProperties[$pluginName][] = ['name' => $fieldName, 'value' => $setting['value']]; - return $coreProperties; } } } From 5bf6d437ddf614a088b287dbd438624ffcd8803b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikke=20Schir=C3=A9n?= Date: Wed, 18 Dec 2024 23:48:54 +0100 Subject: [PATCH 2/2] fix phpcs errors --- plugins/SitesManager/API.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/SitesManager/API.php b/plugins/SitesManager/API.php index f25c1ace26e..b50de0d06fd 100644 --- a/plugins/SitesManager/API.php +++ b/plugins/SitesManager/API.php @@ -807,11 +807,10 @@ private function setSettingValue($fieldName, $value, $coreProperties, $settingVa if (empty($coreProperties[$pluginName])) { $coreProperties[$pluginName] = []; } - if (isset($setting['value'])){ + if (isset($setting['value'])) { $coreProperties[$pluginName][] = ['name' => $fieldName, 'value' => $setting['value']]; return $coreProperties; } - } } }