From f963b9a19f7b135a9141da34b1af0104a02ca5b3 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Wed, 18 Sep 2024 13:24:26 +0100 Subject: [PATCH] Fix selected-index of Countries drop-down --- resources/macros/macros.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/macros/macros.php b/resources/macros/macros.php index 1b2c127a4f..db7b1d08b4 100644 --- a/resources/macros/macros.php +++ b/resources/macros/macros.php @@ -40,18 +40,18 @@ Form::macro('countries', function ($name = 'country', $selected = null, $class = foreach ($countries_array as $abbr => $country) { - // We have to handle it this way to handle deprecication warnings since you can't strtoupper on null + // We have to handle it this way to handle deprecation warnings since you can't strtoupper on null if ($abbr!='') { $abbr = strtoupper($abbr); } // Loop through the countries configured in the localization file - $select .= ' '; + $select .= ' '; } // If the country value doesn't exist in the array, add it as a new option and select it so we don't drop that data - if (!in_array($selected, $countries_array)) { + if (!array_key_exists($selected, $countries_array)) { $select .= ' '; }