Review main Merged

82513[FEATURE] Add PSR-14 Event to modify loaded form definitions

Oli Bartsch CR +2 V +2 Hard +260 −22 updated 01/24/24, 18:35

Commit message

This introduces the new PSR-14 AfterFormDefinitionLoadedEvent,
enabling extension authors to modify loaded form definitions.

The Event is dispatched by the `FormPersistenceManager` after
the form definition was loaded from either cache or the
filesystem, just before being overridden by TypoScript.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 1215

  1. Oli Bartsch uploaded patch set 1 01/18/24, 14:43

  2. core-ci voted on patch set 1 V +1 01/18/24, 14:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51763

  3. Oli Bartsch uploaded patch set 2 V +1 01/18/24, 15:03

  4. core-ci voted on patch set 2 V +1 01/18/24, 15:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51766

  5. Daniel Goerz commented on patch set 2 01/18/24, 16:21

    AfterFormDefinitionLoadedEvent.php:28

    I dont know how useful the cacheKey is.

    FormPersistenceManager.php:142

    Wouldn't it be better to apply the overrides before setting the runtime cache, so that the overrides do not need to be applied multiple times?
  6. Oli Bartsch commented on patch set 2 01/18/24, 20:25

    AfterFormDefinitionLoadedEvent.php:28 Reply

    Me neither. However, IMO the more information we can provide the better.

    FormPersistenceManager.php:142 Reply

    I actually don’t want to change the existing logic. There might be good reasons for applying possible overrides after caching. I think of TypoScript conditions etc.
  7. Daniel Goerz commented on patch set 2 01/19/24, 10:38

    FormPersistenceManager.php:142 Reply

    Bit it is a RUNTIME cache
  8. Oli Bartsch commented on patch set 2 01/19/24, 10:53

    FormPersistenceManager.php:142 Reply

    Maybe I'm overlooking sth. but since the cache key does not consider the overrides, this would not work.
  9. Daniel Goerz commented on patch set 2 01/19/24, 12:56

    FormPersistenceManager.php:142 Reply

    Sorry, I cant follow what you mean by that. I'd suggest to remove the override from line 119 und just do it before the resulting array is runtime-cached in line 140. If you insist on not doing that, thats also fine with me, just what I stumbled upon when reading the code.
  10. Benni Mack voted on patch set 2 CR +1 V +1 01/24/24, 11:18

  11. Nikita Hovratov uploaded patch set 3 CR +1 V +1 01/24/24, 17:23

  12. Nikita Hovratov voted on patch set 3 CR +1 V +1 01/24/24, 17:25

  13. core-ci voted on patch set 3 V +1 01/24/24, 17:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52103

  14. Oli Bartsch voted on patch set 3 CR +2 V +2 01/24/24, 18:35

  15. Oli Bartsch merged patch set 4 01/24/24, 18:35