You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're implementing version 7.0.01 for our Hyrax repository (3.6). (Because of our Hyrax version and its dependencies, we're evidently not able to install anything higher.) The functionality works fine, but an error appears in the logs when executing a catalog search without range limits (or when removing a range facet):
NoMethodError (undefined method `[]' for false:FalseClass)
I've traced this error back to the fetch_specific_range_limit method in the RangeLimitBuilder module. As I understand it, this method gets added to the Blacklight processor chain specifically for the benefit of an AJAX request that is used to update the range facet. After some laborious debugging, I've determined that this method is -- in our case -- receiving an empty hash for the blacklight_params object, which should in fact contain the range limit parameters. And that object in turn seems to derive from Hyrax::SearchService.search_results, which yields a search builder configured using the search-service object's user_params attribute.
Because the params attribute seems to have the range parameters in the relevant case, I'm able to make the error go away by patching the Hyrax::SearchService.search_results method as follows:
if (respond_to?(:params) && user_params.empty?)
builder = search_builder.with(params)
else
builder = search_builder.with(user_params)
end
But that feels like a hack, so I'd much rather learn that we've configured something amiss, or else that this behavior has been fixed in a later version of the range limit gem.
We've included the RangeLimitBuilder module in our app's SearchBuilder module, and the catalog controller and routes are configured per the gem's specifications.
Any suggestions you can offer would be much appreciated.
Thank you!
Dolsy
The text was updated successfully, but these errors were encountered:
Hi there,
Thank you for the Blacklight range limit gem!
We're implementing version 7.0.01 for our Hyrax repository (3.6). (Because of our Hyrax version and its dependencies, we're evidently not able to install anything higher.) The functionality works fine, but an error appears in the logs when executing a catalog search without range limits (or when removing a range facet):
I've traced this error back to the
fetch_specific_range_limit
method in theRangeLimitBuilder
module. As I understand it, this method gets added to the Blacklight processor chain specifically for the benefit of an AJAX request that is used to update the range facet. After some laborious debugging, I've determined that this method is -- in our case -- receiving an empty hash for theblacklight_params
object, which should in fact contain the range limit parameters. And that object in turn seems to derive fromHyrax::SearchService.search_results
, which yields a search builder configured using the search-service object'suser_params
attribute.Because the
params
attribute seems to have the range parameters in the relevant case, I'm able to make the error go away by patching theHyrax::SearchService.search_results
method as follows:But that feels like a hack, so I'd much rather learn that we've configured something amiss, or else that this behavior has been fixed in a later version of the range limit gem.
We've included the
RangeLimitBuilder
module in our app'sSearchBuilder
module, and the catalog controller and routes are configured per the gem's specifications.Any suggestions you can offer would be much appreciated.
Thank you!
Dolsy
The text was updated successfully, but these errors were encountered: