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
Combined: Keep standard recommendations that are not overridden #3264
Combined: Keep standard recommendations that are not overridden #3264
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @maccabeelevine, this looks like a promising start! I'll do some deeper testing on this tomorrow if time permits, but in the meantime, one small suggestion...
|
||
// Special case: override recommend settings through parameter (used by | ||
// combined search) | ||
if ($override) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe if (is_array($override)) {
to prevent unexpected behavior if invalid parameters are passed in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change. I'm a little skeptical because that check wasn't done in the legacy code so it changes the behavior, and I'm not sure $override being an array tells us too much about it having valid content. But it's still incremental improvement, so probably no harm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My goal is to avoid fatal errors. If you give the code a junk array, the junk data will be ignored. But if you pass a non-array to array_merge, you'll blow everything up entirely. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @maccabeelevine, this seems to be working as expected for me.
However, while testing it, I discovered a semi-related problem -- the "include_recommendations = true" setting no longer worked correctly -- it was broken in #3135. I've fixed the problem here, but I'm also going to open a PR targeting release-9.1 to get that bug sorted out. Once we get that approved and merged, I think we can go ahead and merge this too.
Sorry I missed that! 'true' is actually the first value documented in combined.ini, not sure how I let that slip. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix, @maccabeelevine!
Fixing an issue discovered in #3258