Skip to content

[6.x] Fix Search utility when index names are customized - #15729

Merged
duncanmcclean merged 1 commit into
statamic:6.xfrom
jasonbaciulis:fix/search-utility-custom-index-names
Oct 27, 2026
Merged

duncanmcclean merged 1 commit into
statamic:6.xfrom
jasonbaciulis:fix/search-utility-custom-index-names

Conversation

@jasonbaciulis

Copy link
Copy Markdown
Contributor

When index names are customized with Index::resolveNameUsing(), updating an index from the Search utility in the Control Panel throws:

InvalidArgumentException: Search index [prefix_default] is not defined.

The utility page posts each index as {name}::{locale}. The controller then tried to turn the name back into the configured handle by removing the _{locale} suffix, but once a resolver has changed the name, that string can't be reversed.

This PR looks the index up by its name in Search::indexes(), which is keyed by name. It's the same approach #15024 took for the search:update command.

@duncanmcclean
duncanmcclean merged commit 48d87ad into statamic:6.x Oct 27, 2026
62 checks passed
@duncanmcclean

Copy link
Copy Markdown
Member

Thanks!

@jasonbaciulis
jasonbaciulis deleted the fix/search-utility-custom-index-names branch October 27, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants