diff --git a/system/Commands/Utilities/Routes/FilterFinder.php b/system/Commands/Utilities/Routes/FilterFinder.php index 7c5c69e8d5a3..7abd0d0d7c7d 100644 --- a/system/Commands/Utilities/Routes/FilterFinder.php +++ b/system/Commands/Utilities/Routes/FilterFinder.php @@ -51,9 +51,12 @@ public function find(string $uri): array { $this->filters->reset(); - $isLocaleExist = strpos($uri, '{locale}') !== false; + // Fix for the search filters command + $isSupportedLocaleOnly = false; + + if (strpos($uri, '{locale}') !== false && Services::routes()->shouldUseSupportedLocalesOnly()) { + $isSupportedLocaleOnly = true; - if ($isLocaleExist) { $uri = str_replace('{locale}', config(App::class)->defaultLocale, $uri); } @@ -73,7 +76,7 @@ public function find(string $uri): array $filters = $this->filters->getFilters(); - if ($isLocaleExist) { + if ($isSupportedLocaleOnly) { $filters['before'] = array_map(static fn ($filter) => '!' . $filter, $filters['before']); $filters['after'] = array_map(static fn ($filter) => '!' . $filter, $filters['after']); }