Review 13.4 Merged

86984[BUGFIX] Allow using parentheses in TypoScript operator functions

Christian Kuhn CR +2 V +2 Hard +303 −9 updated 11/14/24, 12:32

Commit message

The TypoScript Parser was not able to parse this:

foo := appendString( AND `uid` NOT IN (48,10,50))

It recogized the first closing parentheses ")" as
function end. The patch fixes this by counting the
number of parentheses to avoid early stop. This
approach is limited, but it establishes backwards
compatibility for most use cases.

A better solution is to have "inner" parentheses
quoted to cope with cases where the number of opening
and closing parentheses don't match, but that's a syntax
addition that needs to be done with a separate patch.

Limits of current approach: In case of extra closing
parentheses, any string is ignored past the first valid
match:

foo = Do
foo := appendString( something(withExtra())))))))))))
// Result: "Do something(withExtra())"

In case of extra opening parantheses and no matching
closing parentheses, the result will be an
empty string/stream:

foo = Do
foo := appendString( something(((((((()
// Result: "Do"

Note multiline assignments remain invalid:

foo = Do
foo := appendString(
something
)

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
  • Verified V +2 Done
    • Christian Kuhn +2
    • core-ci +1 CI

Issues 4

Files 4

Review log 34

  1. Christian Kuhn uploaded patch set 1 11/14/24, 11:52

  2. core-ci voted on patch set 1 V +1 11/14/24, 11:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69431

  3. Christian Kuhn voted on patch set 1 CR +2 V +2 11/14/24, 12:32

  4. Christian Kuhn merged patch set 2 11/14/24, 12:32