Bug #91699

page record used in condition matcher is not translated

Added by Lars Peter Søndergaard almost 2 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-06-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I have a condition like:

[page["seo_title"] != ""]
    config.pageTitle.cObject = TEXT
    config.pageTitle.cObject.data = page:seo_title
[END]

With the TypoScript configuration:

config.pageTitleSeparator = -
config.pageTitleSeparator.noTrimWrap = | | |
config.pageTitleFirst = 1

And the templates sitetitle is set to some non empty value.

This generates somewhat decent title in case seo_title is empty and the condition above allows the editors to override the full title using the seo_title in case something special is needed.
Sadly, you cannot override the full title using a custom PageTitleProvider. The sitetitle part always stays untouched.

Now the Problem is: It seems the page variable used in the condition does not yet have the translation overlay applied to it. So in the case where the default language has seo_title set to some non empty value, but in the translated page the seo_title field is still empty, the Condition still evaluates to true when visiting the translated page in the frontend and therefor tries to output the contents of seo_title using the pageTitle.cObject override. Which is going to fail since the field is empty for the translation (no title is output).

The same happens in TYPO3 10 as well.

#1

Updated by Benni Mack 5 months ago

  • Status changed from New to Closed

This was a conceptual issue which we could fix in v11 (was a breaking change). See https://review.typo3.org/c/Packages/TYPO3.CMS/+/65044

The original issue was #23736 which matches the same as your original request.

I will close this issue, if you feel this is the wrong approach, let me know.

Also available in: Atom PDF