#100775TCEFORM altLabels for empty values don't work
Description
Hi,
setting an altLabel for an empty value in TCEFORM doesn’t seem to work anymore.
My tsconfig file contains these lines:
space_after_class {
altLabels {
. = Custom label
}
}
After the update from 11 to 12 I get the following error:
#1655824257 LogicException
Identifier token stream must not be empty
If I change the tsconfig to
space_after_class.altLabels.. = Custom label
The error doesn’t occur anymore, but the label doesn’t change as well.
Reviews 2
Related issues 1
Files 1
History 1120
-
Christian Kuhn commented <span data-processor="relativetime" data-value="2023-05-02T06:39:14+00:00" > 05/02/23, 06:39 </span>
-
Christian Kuhn changed Related to #97816 <span data-processor="relativetime" data-value="2023-05-02T06:56:00+00:00" > 05/02/23, 06:56 </span>
-
Benni Mack changed Sprint Focus Stabilization Sprint <span data-processor="relativetime" data-value="2023-06-06T12:49:26+00:00" > 06/06/23, 12:49 </span>
-
Benni Mack changed Sprint Focus
Stabilization SprintOn Location Sprint <span data-processor="relativetime" data-value="2023-08-02T14:46:13+00:00" > 08/02/23, 14:46 </span> -
Marcin Sągol commented and changed attached clipboard-202311091157-ptx5z.png <span data-processor="relativetime" data-value="2023-11-09T10:57:35+00:00" > 11/09/23, 10:57 </span>
@lolli do you have any suggestion how we should solve this issue? There are several topic to consider here, and i will try to describe them.
First of all with current implementation (and as mentioned in this issue description) if we try to override this default value using the multiline syntax, we end up with the exception in the backend and it will break pretty much all modules inside Web section in TYPO3 panel, and only way to fix them, would be to go do database and remove fault tsconfig configuration from there to be able to load those modules again. So the question is – should we throw exception in such case, or handle this wrong configuration some other way (also to consider why this exception is not thronw for single line syntax).
Second, as you mentioned, having it working with old TS parser was a side effect, but even with there not all cases worked. For example you can’t remove items with empty strig as a value with the `.removeItmes` method. This will ignore such item anyway.
Third, to make it work we could try to fix it in the new TS parser, but the question is if we should? Or shall we indeed think about it as a wrong/unsupported syntax. We could also for this single case (mentioned in issue description) set default value for this item as `default` no empty string. This way we can reference and modify valid value. But this could be a breaking change and also rises question if we should change it only for this single column in core or also for all others that exist and have default value as a empty string?
We should also update documentation. Now it states that we can use double dot syntax to override default value which is a empty string:
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2023-11-09T15:53:49+00:00" > 11/09/23, 15:53 </span>
How about inventing a custom placeholder like “__empty” or “_null” something like this? And letting that replace this “dot” syntax:
TCEFORM.tt_content.space_before_class.altLabels.__empty = foo TCEFORM.tt_content.space_after_class { altLabels { __empty = FoobyDoo } }Of course it would mean adapting all the code that previously reacted on the “dot”.
Using the invalid dot-syntax would then still explode (that’s fair I guess), and there’s no real BC here if the former syntax currently doesn’t work, but I’d suggest to declare it as a BC-level impact ChangeLog entry to let people recognize formally, that the notation was dropped (and be reflected in the docs).
-
Christian Hackl commented <span data-processor="relativetime" data-value="2024-04-03T11:15:59+00:00" > 04/03/24, 11:15 </span>
I would advocate the third option (i.e. add “default” as a value for all fields where this is missing).
Because in a form with a select field and a selected “option” without a value, the “innerHTML” string is always transferred… And we could theoretically translate this “innerHTML”, then depending on the translation something else would be in the request <- stupid.
It would also be consistent!The alternative would be to completely rebuild the select option thing by only using the “innerHTML” values as the value and giving the option the “label” attribute.
Simple example to understand:
<!DOCTYPE html> <html lang="en"> <head> <title>test</title> </head> <body> <form action="/test.php"> <select name="test"> <option>empty</option> <option label="cool">dd</option> <option value="10">10</option> </select> <input type="submit" value="send"> </form> <div> <?php var_dump($_REQUEST); ?> </div> </body> </html> -
Garvin Hicking changed category <span data-processor="relativetime" data-value="2024-07-31T11:17:09+00:00" > 07/31/24, 11:17 </span>
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2025-11-19T13:39:24+00:00" > 11/19/25, 13:39 </span>
(Added to the docs as a “known issue”: https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-Typoscript/pull/1650)
If this bug gets fixed, we need to adjust that.
-
Gerrit Code Review pushed patch set 1 for main to change 91752 status
NewUnder Review <span data-processor="relativetime" data-value="2025-11-19T14:14:58+00:00" > 11/19/25, 14:14 </span> -
Gerrit Code Review pushed patch set 2 for main to change 91752 <span data-processor="relativetime" data-value="2025-11-19T15:22:06+00:00" > 11/19/25, 15:22 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 91752 <span data-processor="relativetime" data-value="2025-11-20T09:55:05+00:00" > 11/20/25, 09:55 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 91752 <span data-processor="relativetime" data-value="2025-11-20T10:09:20+00:00" > 11/20/25, 10:09 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 91752 <span data-processor="relativetime" data-value="2025-11-20T10:30:34+00:00" > 11/20/25, 10:30 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 91752 <span data-processor="relativetime" data-value="2025-11-20T10:32:42+00:00" > 11/20/25, 10:32 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 91752 <span data-processor="relativetime" data-value="2025-12-18T07:42:02+00:00" > 12/18/25, 07:42 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 92154 <span data-processor="relativetime" data-value="2025-12-18T08:06:12+00:00" > 12/18/25, 08:06 </span>
-
Gerrit Code Review pushed patch set 2 for 13.4 to change 92154 <span data-processor="relativetime" data-value="2025-12-18T08:11:25+00:00" > 12/18/25, 08:11 </span>
-
Can Karadag commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-12-18T08:50:09+00:00" > 12/18/25, 08:50 </span>Applied in changeset commit:ea72d5b5b21714fef21153761812499d56a5e972.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-03-31T09:00:34+00:00" > 03/31/26, 09:00 </span>
Well, from TS parser point of view, that’s invalid syntax.
It looks as if this syntax exception is only documented / usable for “altLabels”, see https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/PageTsconfig/TceForm.html#altlabels
Overriding the ‘default’ this way is odd in the first place. I must admit, I did not had this special case on my radar, that’s why new ts parser explodes here. Guess we’ll have to play around with this to find some solution since I think the “empty dot” isn’t something we should allow since it collides with syntax specs, and was just a weird side effect of old parser.