Issue Bug Closed

#88847Getting site configuration via TypoScript is not respecting conditions

Philipp Seiler 07/26/19, 10:11 updated 12/23/19, 22:45

Description

  • Have a site configuration like:
rootPageId: 1
base: 'https://www.website.com/'
baseVariants:
  - base: 'https://remote-dev.website.com/'
    condition: 'applicationContext == "Development"'
  - base: 'http://local-dev.website.com/'
    condition: 'getenv("LOCAL_DEVELOPMENT") == 1'
  • Try to add <base href> to the website header via
page.headerData.1234 = TEXT
page.headerData.1234 {
    data = site:base
    wrap = <base href="|">
}
  • When visiting https://remote-dev.website.com/, the base-tag will be filled with http://local-dev.website.com/ => Incorrect.
  • Reason is, that within the ContentObjectRenderer in the getData method the site configuration is extracted via Array-Path site:baseVariants.0.base.
  • It simply takes the first base variant available, not respecting conditions in any way.
  • Result is, that all links are broken, as the base-tag is incorrect.
  • Getting site configuration in that way should respect the whole configuration including conditions like everywhere else.
  • I thought that the SEO-Extension had the same problem with creating the canonical-tag. However, the link there is created differently via generateUri method of the PageRouter.

Current workaround is to put reverse the order of the baseVariants and add additional conditions to check for local development and/or remote development.

Reviews 2