Project

General

Profile

Actions

Bug #102580

open

Translate ViewHelper does not use default argument when non existing key is given

Added by Felix Nagel 5 months ago. Updated 3 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2023-12-01
Due date:
% Done:

0%

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

Description

When using the translate ViewHelper in TYPO3 12.4.8 with a non existing key the default value is ignored. This worked in TYPO3 11.5.x and before.

Example:
<f:translate key="non.existing.key" default="some default text" />

Expected output would be "some default text" but actual output is "".

Actions #1

Updated by Oliver Bartsch 4 months ago

  • Status changed from New to Needs Feedback

Hi, thanks for reporting. I just checked this on latest main and latest 12.4 and was not able to reproduce the reported bug. The default is displayed as expected. Could you please verify whether this is also fixed for you?

Best, Oli

Actions #2

Updated by Felix Nagel 4 months ago ยท Edited

You are right. It's not a general issue but something within my extension (https://github.com/fnagel/t3extblog). I've tried to figure out what exactly by removing most PHP code, TS configuration, TSconfig, routing, etc. but the error won't go away. This still worked in TYPO3 v11 :-(

A strange behavior I've noticed is that this does work when I use a WRONG "extensionName" argument in the VH code. How is that possible?

Any idea what might be the issue here?

Actions #3

Updated by Benni Mack 3 months ago

Any idea what might be the issue here?

Hey Felix,

do you run your extension in middleware or something along the lines? Can you share the Fluid code how this happened?

Actions

Also available in: Atom PDF