From 9e823b6fddeb9b2b5f03e76cc0d69b19744eafe2 Mon Sep 17 00:00:00 2001 From: i-just Date: Thu, 1 Oct 2026 10:06:12 +0200 Subject: [PATCH 1/2] only exclude the Default.json file if we're already handling it by setting $includeDefault to true --- src/HtmlField.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/HtmlField.php b/src/HtmlField.php index d937947..9778e55 100644 --- a/src/HtmlField.php +++ b/src/HtmlField.php @@ -549,12 +549,17 @@ protected function configOptions( foreach ($files as $file) { $filename = basename($file); - if ($filename !== 'Default.json') { - $options[$filename] = $includeExtensions ? $filename : pathinfo($file, PATHINFO_BASENAME); - } + $options[$filename] = $includeExtensions ? $filename : pathinfo($file, PATHINFO_BASENAME); } } + // if we're including the default, + // and we found a file named Default.json (which can only happen if *.json is allowed by the $only option) + // remove that file from the $options list as it's expected to be handled by the $includeDefault option + if ($includeDefault && isset($options['Default.json'])) { + unset($options['Default.json']); + } + ksort($options); return $options; From 94c401abaf74c8df05d204224cef9db0bfec9dbe Mon Sep 17 00:00:00 2001 From: i-just Date: Thu, 1 Oct 2026 15:24:23 +0200 Subject: [PATCH 2/2] only exclude files where lowercased name is "default" when includeDefault is true --- src/HtmlField.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/HtmlField.php b/src/HtmlField.php index 9778e55..0f88bb0 100644 --- a/src/HtmlField.php +++ b/src/HtmlField.php @@ -549,17 +549,15 @@ protected function configOptions( foreach ($files as $file) { $filename = basename($file); + // Exclude `default` files if $includeDefault is true, to prevent confusion between e.g. "Default" and "Default.json" + if ($includeDefault && strtolower(pathinfo($filename, PATHINFO_FILENAME)) === 'default') { + continue; + } + $options[$filename] = $includeExtensions ? $filename : pathinfo($file, PATHINFO_BASENAME); } } - // if we're including the default, - // and we found a file named Default.json (which can only happen if *.json is allowed by the $only option) - // remove that file from the $options list as it's expected to be handled by the $includeDefault option - if ($includeDefault && isset($options['Default.json'])) { - unset($options['Default.json']); - } - ksort($options); return $options;