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

Removing a fielded search for a search field with clause params builds invalid JSON queries #3048

Closed
barmintor opened this issue Jun 22, 2023 · 0 comments · Fixed by #3057
Closed
Labels

Comments

@barmintor
Copy link
Contributor

Error: Blacklight::Solr::SearchBuilderBehavior#add_search_field_with_json_query_parameters builds invalid JSON queries when a search field has been specified but all constraint values have been removed
Steps to reproduce:

  1. Configure clause_params for the title search field
  2. Search in the title field
  3. Remove the constraint by clicking the 'X' in the results page

Remediation:
The method should either return early if search_state.query_param is nil, or default to a blank string if it is falsy

@barmintor barmintor added the Bug label Jun 22, 2023
barmintor added a commit to barmintor/blacklight that referenced this issue Jun 22, 2023
barmintor added a commit to barmintor/blacklight that referenced this issue Jul 6, 2023
barmintor added a commit to barmintor/blacklight that referenced this issue Jul 7, 2023
barmintor added a commit to barmintor/blacklight that referenced this issue Jul 7, 2023
maxkadel pushed a commit to maxkadel/blacklight that referenced this issue Sep 8, 2023
barmintor added a commit to barmintor/blacklight that referenced this issue Sep 8, 2023
jcoyne added a commit that referenced this issue Sep 11, 2023
do not add nil query value clauses to json query (#3048)
sandbergja pushed a commit that referenced this issue Sep 11, 2023
* do not add nil query value clauses to json query (#3048)

* Add test for empty query with JSON DSL

* Update to use options for feature specs

---------

Co-authored-by: Benjamin Armintor <armintor@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant