Uploaded image for project: 'Extended Templating Kit (closed)'
  1. Extended Templating Kit (closed)
  2. MGNLETK-29

LinkUtil fails to generate links in the multi site environment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.3.1
    • 1.3.1
    • None

      Inside my AbstractSyndFeedGenerator implementation I run a query on some content nodes, and then for each node create a SyndEntry where I use info.magnolia.link.LinkUtil.createAbsoluteLink(content) to create the rss item link. This causes a stack trace, which I include.

      I traced the problem to info.magnolia.module.extendedtemplatingkit.CrossSiteAbsolutePathTransformer.prefixLink(String linkStr).
      This method is quite complicated, but I can guess what goes wrong:
      Because the request is on http://tegenlicht.localhost:8080/rss/?generatorName=tegelicht-nieuws it is not a request on the website workspace and the site is not resolved in the course of the request handling, so the configuration is not part of the request context.

      I had some communication about this with Jan, who suggested I should use LinkUtil.createExternalLink(). But this method does not know how to resolve the hostname (based on multi site configuration), and it also does not know how the links to pages in the site should be created.

      I hope this information is sufficient. If not, i will supply what is required.

        Acceptance criteria

              had Jan Haderka
              ebunders Ernst Bunders
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: