Review main Ready for review Quiet

95893[BUGFIX] Handle undefined index in EMUtility::addRecordType

Simon Schaufelberger CR -1 V +1 Easy +25 −1 updated 11/04/26, 18:16

Commit message

Add a nullable check for passing a nonexistent label.

Add more tests that are also used for
ExtensionManagementUtility::addTcaSelectItem

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 2
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/93/95893/2 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/93/95893/2 && git cherry-pick FETCH_HEAD

Review

  • Code review CR -1 Needs a vote
    • Oliver Klee +1
    • Garvin Hicking -1
    • Ravi Sachaniya +1
  • Verified V +1 Needs a vote
    • Oliver Klee +1
    • Ravi Sachaniya +1
    • core-ci +1 CI

Merge conflicts 1

Issues 1

Files 2

Review log 1821

  1. Simon Schaufelberger uploaded patch set 1 09/16/26, 20:41

  2. core-ci voted on patch set 1 V +1 09/16/26, 20:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108721

  3. Georg Ringer voted on patch set 1 CR +1 V +1 09/17/26, 05:34

  4. Ravi Sachaniya voted on patch set 1 CR +1 09/17/26, 09:25

  5. Nikita Hovratov commented on patch set 1 09/17/26, 09:45

    Label should always be required for "items". Not sure if softening it here is a good idea.
  6. Simon Schaufelberger commented on patch set 1 09/17/26, 10:15

    Reply

    but then we should throw an exception instead like for the other required items
  7. Oliver Klee voted on patch set 1 CR +1 V +1 09/17/26, 11:12

  8. Nikita Hovratov commented on patch set 1 09/17/26, 12:42

    Reply

    Quick fix could be defaulting to "null". This will throw an invalid argument exception instead of undefined array key. Or even better validate the input in addRecordType and throw the exception there. Then you can also include the type in the exception message for context. If you would omit the label in hard-coded TCA, then an error would be seen when opening the FormEngine. So such a fix would at least be seen way earlier.
  9. Simon Schaufelberger uploaded patch set 2 CR +1 V +1 09/22/26, 20:17

  10. Simon Schaufelberger commented on patch set 2 09/22/26, 20:20

    Reply

    I have added a check directly in the fromTcaItemArray as this is also called in other places.
  11. core-ci voted on patch set 2 V -1 09/22/26, 20:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109012

  12. core-ci voted on patch set 2 V +1 09/22/26, 20:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109012

  13. Simon Schaufelberger commented on patch set 2 10/15/26, 11:55

    Reply

    Done
  14. Oliver Klee voted on patch set 2 CR +1 V +1 10/15/26, 13:43

  15. Ravi Sachaniya voted on patch set 2 CR +1 V +1 10/19/26, 08:33

  16. Garvin Hicking commented on patch set 2 CR -1 11/04/26, 12:36

    Could you elaborate in which case this is an issue or problem for you? Basically you're prepending a RuntimeException in exchange of a TypeError. Both very much hint at the underlying problem that you're using API with missing data. I don't think we should begin to introduce exception handling for things that strict typing should handle and which only occurs in malformed integration? (Happy to discuss this if there's reasoning/use case for this, but I couldn't extract that from either the issue nor the commit message)
  17. Simon Schaufelberger commented on patch set 2 11/04/26, 12:54

    Reply

    I stumbled over this bug when i was creating new content elements and forgot to add a label. see https://docs.typo3.org/permalink/t3coreapi:addingce-tca-overrides-tt-content Now instead of getting the undefined index warning, a hard error is thrown to make me aware that something is wrong.
  18. Garvin Hicking commented on patch set 2 11/04/26, 16:10

    Reply

    hm, but the undefined index also makes you aware of that with a stacktrace?!
  19. Simon Schaufelberger commented on patch set 2 11/04/26, 16:31

    Reply

    no, not if you mute the warnings
  20. Garvin Hicking commented on patch set 2 11/04/26, 17:55

    Reply

    Why would you mute warnings in the environment where you do development?
  21. Simon Schaufelberger commented on patch set 2 11/04/26, 18:16

    Reply Unresolved

    I work mostly in Production/Simon context to have the page rendering speed of the production system as Development context can be really slow and slows me down too much.