Review main Merged

81581[BUGFIX] Simplify regex for form finisher FlexForm overrides

Nikita Hovratov CR +2 V +2 Easy +13 −3 updated 10/26/23, 16:39

Commit message

EXT:form automatically generates FlexForm for form finisher overrides
based on YAML configuration in the `finishersDefinition.FormEngine`
sub-array. Since the removal of `TCEforms` for FlexForm (#97126), the
regex to match valid FlexForm fields did a "too good" job and also
added fields from section containers. These were guarded by a negative
lookbehind `(?>!\.TCEforms)`. Note the dot. This basically means ignore
anything, which has something else before TCEforms (=sections).

This was mostly fixed with #101050 by ignoring anything with a dot
before `config.type`. Sadly, this also ignored FlexForm identifiers with
dots in their name. In this case `translation.language.config.type`.

This whole regex thing is a mess and partially was the reason these
issues started as soon as something changed in the FlexForm syntax. Now,
in order to fix this, section containers are kicked from the array with
plain old PHP logic. This way we don't need to come up with a super
smart regex like "anything that ends with `config.type` but not preceded
by `_arrayContainer`". I tried and I failed.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 3

Files 1