84909[BUGFIX] Allow using parentheses in TypoScript operator functions
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Oli Bartsch +1
-
Verified V +2 Done
- Christian Kuhn +2
- Oli Bartsch +1
- core-ci +1 CI
Issues 4
Files 4
- typo3/sysext/core/Classes/TypoScript/Tokenizer/LosslessTokenizer.php+17 −5
- typo3/sysext/core/Classes/TypoScript/Tokenizer/LossyTokenizer.php+16 −4
- typo3/sysext/core/Tests/Unit/TypoScript/AST/AstBuilderInterfaceTest.php+91 −0
- typo3/sysext/core/Tests/Unit/TypoScript/Tokenizer/TokenizerInterfaceTest.php2+179 −0
Review log 2733
Show 68 earlier messages
-
Garvin Hicking uploaded patch set 1 06/25/24, 13:39
-
core-ci voted on patch set 1 V +1 06/25/24, 13:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60304
-
Garvin Hicking rebased onto patch set 2
V +107/28/24, 07:22 -
Georg Ringer voted on patch set 2 CR +1 V +1 07/28/24, 07:22
-
core-ci voted on patch set 2 V +1 07/28/24, 07:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62344
-
Christian Kuhn commented on patch set 2 CR -1 07/29/24, 13:01
this needs tests in typo3/sysext/core/Tests/Unit/TypoScript/Tokenizer/TokenizerInterfaceTest.php to show/verify the token stream. -
Garvin Hicking uploaded patch set 3
CR +1V +107/30/24, 17:07Add TokenizerInterfaceTest cases -
Garvin Hicking commented on patch set 3 07/30/24, 17:08
Reply
Added a few tests. Unsure about that one place I marked with "@todo", please dadvise. :-)
-
Garvin Hicking commented on patch set 3 07/30/24, 17:08
TokenizerInterfaceTest.php:3654^^ here -
core-ci voted on patch set 3 V +1 07/30/24, 17:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62462
-
Georg Ringer voted on patch set 3 CR +1 V +1 07/31/24, 15:12
-
Garvin Hicking commented on patch set 3 08/21/24, 19:39
(Discussed with Lolli. Will have a look at this after Feature Freeze) -
Garvin Hicking rebased onto patch set 4
CR +1V +109/18/24, 09:19 -
core-ci voted on patch set 4 V +1 09/18/24, 09:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66112
-
Benni Mack updated the commit message in patch set 5
V +110/18/24, 13:53 -
Christian Kuhn commented on patch set 5 10/21/24, 09:52
missed this one when i looked at open ts parser issues last week. oli pointed me to it, we should get it done. will have a closer look soon. -
Garvin Hicking commented on patch set 5 10/21/24, 13:00
Reply
Thanks. I'm a bit afraid of this "counting parantheses" approach, even though test says it seems to work. So I'm open to feedback. We should check if a bugfix is something to backport to v12 (I'd say yes). -
Oli Bartsch commented on patch set 5 10/21/24, 14:20
Reply
This should definitely be backported to v12. -
Christian Kuhn commented on patch set 5 11/11/24, 14:56
Reply
i think we should add tests to see what happens if there is a comment that contains "(" and/or ")" after a := function. -
Christian Kuhn commented on patch set 5 11/11/24, 14:57
i'll try to work on this tomorrow. -
Christian Kuhn commented on patch set 5 11/13/24, 15:53
TokenizerInterfaceTest.php:3654ReplyThat strategy is done at multiple places in the parser: when it knows a line is "finished" at some point, and there is some left-over, it is treated as comment. I guess its fine to do this here as well. -
Christian Kuhn commented on patch set 5 11/13/24, 16:23
Hey. Yes, this fixes the issue for situations like this: foo := addToList(a, (, )) and foo := appendString( AND `uid` NOT IN (48,10,50)) I think we should do this since it re-establishes b/w compat - it worked before like that. The solution is based on the fact that there is the name number of opening and closing parenthesis within the () encapsulated function body. However, this breaks: foo := addToList(a, (, b) and foo := addToList(a, ), b) Stuff like this can only be solved in a clean way, when the special character within the body are quoted. We have some quote logic in the parser with identifiers already: foo.bar\.baz is segment 'foo' and segment 'bar.baz'. We could eventually add this with another patch: '\(' ignores the '(' and treats it as literal, as well as '\)', '\\(' would be '\(', and '\\)' would be '\)'. We could state that quoting '(' and ')' is best practice and should always be done to avoid issues. What do you think? -
Christian Kuhn commented on patch set 5 11/13/24, 16:24
Reply
args. gerrit ate the backslashes away. -
Christian Kuhn commented on patch set 5 11/13/24, 16:31
Reply
an identifier "foo.bar\\.baz" is segment "foo" and segment "bar.baz". proposal: "\\(" takes the special meaning of "(" away in function body, as well as "\\)" for ")". This would be an addition to this patch, and a better best practice we could communicate. And since constant substitution happens after tokenizing, it shouldn't be an issue when a constant contains parenthesis. -
Christian Kuhn uploaded patch set 6 11/14/24, 11:45
-
Christian Kuhn commented on patch set 6 11/14/24, 11:45
Reply
DoneReply
DoneReply
AcknowledgedReply
there is a simple test for "left over stuff is turned into a comment". that should be fine for now. -
Christian Kuhn updated the commit message in patch set 7 11/14/24, 11:46
-
core-ci voted on patch set 6 V +1 11/14/24, 11:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69429
-
core-ci voted on patch set 7 V +1 11/14/24, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69430
-
Christian Kuhn voted on patch set 7 CR +1 V +1 11/14/24, 12:21
-
Oli Bartsch voted on patch set 7 CR +1 V +1 11/14/24, 12:26
-
Christian Kuhn voted on patch set 7 CR +2 V +2 11/14/24, 12:32
-
Christian Kuhn merged patch set 8 11/14/24, 12:32