scientist-softserv / west-virginia-university

West Virginia University
0 stars 0 forks source link

Softserv dev (#10) #119

Closed kirkkwang closed 10 months ago

kirkkwang commented 10 months ago

Resequence list in catalog controller to sort facets alphabetically.

Related to:

Once I added the blacklight_advanced_search gem, I ran the following:

docker compose exec web bundle

This added blacklight_advanced_search to the gem dependency graph by updating the Gemfile.lock

Related to:

These files were generated via:

docker compose exec web rails generate blacklight_advanced_search:install

Note: The documentation said to run rails generate blacklight_advanced_search, however during the installation it mentioned that was deprecated in favor of the above. So I reset and ran the command based on the guidance of the generator (figuring that guidance was likely more correct).

During the installation, the generator asked:

Install local search form with advanced link? (y/N)

I answered y.

Related to:

Prior to this commit, the "More Options" floated beneath the form; looking very much out of place.

With this change, it's inline and appropriate.

Prior to this commit I was getting the following exception:

ArgumentError in AdvancedController#index
wrong number of arguments (given 2, expected 1; required keyword:
ability)

It turns out that during the AdvancedController#index request cycle we instantiate Blacklight::AccessControls::SearchBuilder multiple times; and with different parameter signatures.

Below are the logged calls of Blacklight::AccessControls::SearchBuilder; note we have only minimal application changes so this appears to be a conflict between versions.

Blacklight::AccessControls::SearchBuilder#initialize with controller as first parameter; caller: /usr/local/bundle/gems/blacklight-access_controls-6.0.1/lib/blacklight/access_controls/catalog.rb:21:in `new'
Blacklight::AccessControls::SearchBuilder#initialize with processor_chain as first parameter; caller: /usr/local/bundle/gems/blacklight-6.25.0/lib/blacklight/search_builder.rb:81:in `new'
Blacklight::AccessControls::SearchBuilder#initialize with processor_chain as first parameter; caller: /usr/local/bundle/gems/blacklight-6.25.0/lib/blacklight/search_builder.rb:61:in `new'

With this commit, I'm introducing a crease in the code to re-arrange the method signature. In doing so the exception mentioned above goes away, and I see the advanced search page.

Related to:


Story

Refs:

Expected Behavior Before Changes

Expected Behavior After Changes

Screenshots / Video

Notes