Uploaded image for project: 'Hippo Plugins'
  1. Hippo Plugins
  2. HIPPLUG-1408

Taxonomy: org.onehippo.taxonomy.api.Category.getInfo(String) does not return localized CategoryInfo object

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: taxonomy-3.1.0
    • Fix Version/s: taxonomy-3.1.1
    • Component/s: Taxonomy
    • Labels:
      None
    • Similar issues:

      Description

      I have a taxonomy with localized category names for English. For example:

      /content/taxonomies/exampletaxonomy/exampletaxonomy
        + clothing
          + shirts
            + long-sleeved-shirts
              + hippotaxonomy:categoryinfos
                + en
                  - hippotaxonomy:name = Long-Sleeved Shirts
      

      In my HST component, I make the org.onehippo.taxonomy.api.Taxonomy object available as request attribute "taxonomy".

      TaxonomyManager taxonomyManager = HstServices.getComponentManager()
              .getComponent(TaxonomyManager.class.getName());
      Taxonomy taxonomy = taxonomyManager.getTaxonomies().getTaxonomy("exampletaxonomy");
      request.setAttribute("taxonomy", taxonomy);
      

      In my Freemarker template, I have:

      <ul>
      <#list document.keys as key>
        <li>
          <#list taxonomy.getCategoryByKey(key).ancestors as ancestor>
            $\{ancestor.getInfo(hstRequest.locale.language).name\} &gt;
          </#list>
          $\{taxonomy.getCategoryByKey(key).getInfo(hstRequest.locale.language).name\}
        </li>
      </#list>
      </ul>
      

      However, instead of the localized names, the keys are printed. It turns out I'm getting a TransientCategoryInfoImpl object.

        Attachments

        1. debug1.png
          debug1.png
          249 kB
        2. debug2.png
          debug2.png
          249 kB

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nvankampenhout Niels van Kampenhout
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: