Issue Bug Closed

#22655typolink creates incomplete links in combination with the forceAbsoluteUrl property

Oliver Hader 05/15/10, 13:25 updated 03/29/11, 14:20

Description

The typolink method creates invalid/incomplete links by using the forceAbsoluteUrl property.
The absolute part and scheme are missing if
  • the page is not visible/accessible and config.typolinkLinkAccessRestrictedPages is used
  • a file resource is linked (e.g. “fileadmin/whatever.gif”)
  • an absolute local URL is linked (e.g. “/”)

The forceAbsoluteUrl should consider also these parts. The attached TypoScript demonstrates the different behaviours for forced absolute URLs and the regular disposal.

page = PAGE
page {
  dokType = 0
  10 = COA
  10 {
    5 = TEXT
    5.value = FORCED ABSOLUTE URL:
    10 = TEXT
    10 {
      typolink {
        parameter.data = page:uid
        forceAbsoluteUrl = 1
        forceAbsoluteUrl.scheme = https
        returnLast = url
      }
      wrap = [|],
    }
    20 < .10
    20.typolink.parameter >
    20.typolink.parameter = /
    30 < .20
    30.typolink.parameter = fileadmin/files/ortsplan.pdf
  }
  20 < .10
  20.5.value = REGULAR:
  20.10.typolink.forceAbsoluteUrl >
}

(issue imported from #M14392)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.