diff --git a/src/main/java/com/erudika/scoold/controllers/QuestionsController.java b/src/main/java/com/erudika/scoold/controllers/QuestionsController.java index 3620f34e..f6d117e1 100755 --- a/src/main/java/com/erudika/scoold/controllers/QuestionsController.java +++ b/src/main/java/com/erudika/scoold/controllers/QuestionsController.java @@ -189,6 +189,8 @@ public String applyFilter(@RequestParam(required = false) String sortby, if (!StringUtils.isBlank(typeFilter)) { HttpUtils.setRawCookie("questions-type-filter", typeFilter, req, res, "Strict", (int) TimeUnit.DAYS.toSeconds(365)); + } else { + HttpUtils.removeStateParam("questions-type-filter", req, res); } savePagerToCookie(req, res, p); HttpUtils.setRawCookie("questions-view-compact", compactViewEnabled, @@ -451,7 +453,7 @@ private String getQueryWithPossibleExtension(String query, HttpServletRequest re queryExt = StringUtils.trimToEmpty(HttpUtils.getCookieValue(req, "questions-type-filter")); } if (!queryExt.isBlank()) { - return query.equals("*") ? queryExt : query + " AND (" + queryExt + ")"; + return query.equals("*") ? queryExt : query + " AND (" + Utils.urlDecode(queryExt) + ")"; } return query; } diff --git a/src/main/resources/templates/questions.vm b/src/main/resources/templates/questions.vm index eee93352..3e0809a6 100755 --- a/src/main/resources/templates/questions.vm +++ b/src/main/resources/templates/questions.vm @@ -221,7 +221,7 @@ #macro(filterselected $prop) #if($questionsTypeFilter == $prop)selected#end #end - #set($unacceptedQuery = "properties.answercount:[1 TO *] NOT properties.answerid:[* TO *]" ) + #set($unacceptedQuery = $utils.urlEncode("properties.answercount:[1 TO *] NOT properties.answerid:[* TO *]") )