Skip to content
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

Conversation

maccabeelevine
Copy link
Member

Fixing an issue discovered in #3258

In AbstractSearch->getSeachSetupCallback(), any recommendOverride settings in combined.ini overrride all of the default recommendation modules from searches.ini / EDS.ini etc. So setting even a top recommendation in combined.ini overrides the noresults recommendations from EDS.ini.

Copy link
Member

@demiankatz demiankatz left a 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) {
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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. :-)

@demiankatz demiankatz changed the title Combined: Keep standard recommendations that are not overriden Combined: Keep standard recommendations that are not overridden Dec 14, 2023
@demiankatz demiankatz added this to the 10.0 milestone Dec 14, 2023
Copy link
Member

@demiankatz demiankatz left a 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.

@maccabeelevine
Copy link
Member Author

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.

Copy link
Member

@demiankatz demiankatz left a 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!

@demiankatz demiankatz merged commit 15cb0c5 into vufind-org:dev Dec 19, 2023
7 checks passed
@maccabeelevine maccabeelevine deleted the combined-noresults-recommendation-conflict branch December 19, 2023 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants