Skip to content

Blacklight params not getting passed to fetch_specific_range_limit method #255

@dolsysmith

Description

@dolsysmith

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions