Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Alerts fq params were being ignored - they were not urlEncoded it turns out, so "&fq=" got read as a new request param by alerts instead of being encapsulated inside the webserviceQuery param.
  • Loading branch information
nickdos committed Feb 1, 2019
1 parent 8c42a0e commit 03b916b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions grails-app/assets/javascripts/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,14 @@ $(document).ready(function() {
}
var methodName = $(this).data("method");
var url = alertsUrlPrefix + "/ws/" + methodName + "?";
var searchParamsEncoded = encodeURIComponent(decodeURIComponent(BC_CONF.searchString)); // prevent double encoding of chars
url += "queryDisplayName="+encodeURIComponent(query);
url += "&baseUrlForWS=" + encodeURIComponent(BC_CONF.biocacheServiceUrl.replace(/\/ws$/,""));
url += "&baseUrlForUI=" + encodeURIComponent(BC_CONF.serverName);
url += "&webserviceQuery=%2Fws%2Foccurrences%2Fsearch" + BC_CONF.searchString;
url += "&uiQuery=%2Foccurrences%2Fsearch%3Fq%3D*%3A*";
url += "&webserviceQuery=%2Fws%2Foccurrences%2Fsearch" + searchParamsEncoded;
url += "&uiQuery=%2Foccurrences%2Fsearch" + searchParamsEncoded;
url += "&resourceName=" + encodeURIComponent(BC_CONF.resourceName);
//console.log("url", query, methodName, url);
//console.log("url", query, methodName, searchParamsEncoded, url);
window.location.href = url;
});

Expand Down

0 comments on commit 03b916b

Please sign in to comment.