-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Allow the defaultSearchTermOptions
config setting to merge with the default array
#2737
Comments
We can’t merge this one setting without merging all arrays, and that's not always going to be desired. |
So we have to recreate the entire 5 key array in our config settings, even if we're just changing a single value? That's unfortunate. Other than "mass merging", is there any other way to address this shortcoming? In that Slack conversation, we discussed the possibility of That would be something that happens when the search is executed, not when the config array is initially compiled. |
Not saying it's the best solution, but we addressed this with the allowedFileExtensions config setting by adding the extraAllowedFileExtensions config setting that gets merged in. It's much more pronounced there because there are so many items in the allowedFileExtensions setting that you'd need to duplicate. |
Hmm, that solution may be extreme for It looks like https://github.com/craftcms/cms/blob/develop/src/services/Search.php#L155-L163 If possible, what I'm proposing is this...
It seems like a minor kludge, but it would be pretty well contained in the Thoughts? |
Actually, let me adjust my previous statement... a perfect place for that null-value comparison would be in the https://github.com/craftcms/cms/blob/develop/src/search/SearchQuery.php#L49-L52 |
I just made sure the default corresponding property values on |
Brilliant, that should work perfectly! Thanks @brandonkelly 👍 |
The default
defaultSearchTermOptions
value is this...The only one I want to change is
subLeft
. But if I add this to my config file...... it breaks the rest of the values in that array.
Can we have it so the config-specified settings get merged with the default settings? I'd rather not re-declare all five array keys when I only need to change a single one.
The text was updated successfully, but these errors were encountered: