Project

General

Profile

Actions

Bug #88847

closed

Getting site configuration via TypoScript is not respecting conditions

Added by Philipp Seiler almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2019-07-26
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
pagerenderer,frontend,base,site,configuration,CodingNight
Complexity:
Is Regression:
Sprint Focus:

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.


Files

88847.diff (2.88 KB) 88847.diff Guido Schmechel, 2019-07-26 11:26
Actions

Also available in: Atom PDF