projectblacklight / blacklight_advanced_search

Advanced search plugin for Blacklight
http://projectblacklight.org
Other
24 stars 25 forks source link

fix multiple parameters in the URL #81

Closed codeforkjeff closed 6 years ago

codeforkjeff commented 7 years ago

This fixes the following bug:

Oddly, it's the 2nd "correct" param that gets used by the search code, so this doesn't actually result in corrupted behavior, only a confusing incorrect URL.

The underlying problem is that while #advanced_search_state excludes search fields from the hidden form inputs that are generated, it's wrapped in a call to search_state.params_for_search which adds them back in. So I've removed that call.

Note that the 2nd test case I added actually passes even without this fix, because capybara's rack_test driver uses only the text input, instead of using both the hidden and text input, which real browsers do. But I've included the test anyway, for completeness. To see the bug in action in a real browser, you can run through the steps above on the code in this repo: https://github.com/codeforkjeff/advanced_search_bug

dkinzer commented 6 years ago

thanks @jkeck !