Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-2896

Facet navigation tag cannot remove facets with $ in the name

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • 2.26.09
    • Backlog
    • hst-api

    Description

      Looks like a bug in org.hippoecm.hst.tag.HstFacetNavigationLinkTag.doEndTag().

      It tries to remove e.g. "Price/$700 - $799" from the path as follows:

      if(path.contains(removeFacetValue)) {
      path = path.replaceAll(removeFacetValue+"(/|
      z)", "");

      but while path.contains returns true, path.replaceAll has no effect in this case. Maybe because the first considers removeFacetValue a String, the second regards it a regular expression. The dollar sign is a special character in a regular expression (it indicates end of string).
      The string should be put through Pattern.quote [1]

      [1] http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#quote(java.lang.String)

      Attachments

        Activity

          People

            wborgbarthet William Borg Barthet
            wborgbarthet William Borg Barthet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: