Skip to content

Commit

Permalink
Add facets to query parameters on non-empty search hash (#715)
Browse files Browse the repository at this point in the history
Using the ginger_search_hash scomp, we can link to search pages with certain filters applied. However facets would not be loaded. This change fixes that.

Co-authored-by: Colin de Roos <[email protected]>
  • Loading branch information
cdfa and Colin de Roos authored Oct 21, 2022
1 parent 33225dd commit faf0faf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/mod_ginger_base/lib/js/search/search_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ $.widget("ui.search_ui", {
json = atob(hash),
values = jQuery.parseJSON(json);

// When pages link to the search page with certain filters enabled, facets are not present in the hash, so we add them here.
// If they would not be added, they would not be requested from the server and they cannot be displayed.
values.facets = this.getMergedFacets();

$.proxy(me.setWidgetsState(values), me);

if (me.blankSearchStarted && me.searchOnLoad == false) {
Expand Down

0 comments on commit faf0faf

Please sign in to comment.