Review main Merged

74127[BUGFIX] Add guard clause to prevent fataling on saving a CE

Jan Helke CR +2 V +2 Easy +2 −2 updated 04/01/22, 11:54

Commit message

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Oliver Klee +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1011

  1. Jan Helke uploaded patch set 1 03/31/22, 13:57

  2. Oli Bartsch commented on patch set 1 03/31/22, 14:02

    How can this be reproduced?
  3. core-ci voted on patch set 1 V +1 03/31/22, 14:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25308

  4. Oliver Klee voted on patch set 1 CR +1 03/31/22, 14:18

  5. Jan Helke commented on patch set 1 03/31/22, 14:29

    Reply

    The gentle way: Create a file containing CE without using getFileFieldTCAConfig and make sure ['config']['filter'][0]['parameters']['disallowedFileExtensions'] is not set. The brute force way: Disable line typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php:597 . That leaves you with no 'disallowedFileExtensions' in all default CEs. Now use a media containing CE of your choice, add e.g. just a header and save. That should do the trick.
  6. Oli Bartsch commented on patch set 1 03/31/22, 15:56

    Reply

    Oke, if I understood this correct, it's not a real use case (does not occur while just using the core)? Core only uses filterInlineChildren() once in getFileFieldTCAConfig() where $disallowedFileExtensions is always set. So, one can only trigger this with a wrong TCA configuration, right? I'm fine with the patch code-wise, just want to learn more about the background.
  7. Jan Helke commented on patch set 1 03/31/22, 16:01

    Reply

    Your absolute right. I needed to research the reason for this too. I was about to say "this will fail with any file CE" just to find out, that all core CEs worked fine. So yes, the core saved itself, but those nerdy "I want to customize everything myself" kinda guys will struggle with this. :-)
  8. Oli Bartsch commented on patch set 1 V +1 CR +1 03/31/22, 19:41

    Reply

    Alright. Thanks for the explanation. As mentioned, code-wise this patch is fine.
  9. Stefan Bürk commented on patch set 1 V +1 CR +1 04/01/22, 11:52

    Reply

    Thanks for the patch and the explanation. Would have asked that myself otherwise.
  10. Oli Bartsch voted on patch set 1 V +2 CR +2 04/01/22, 11:53

  11. Oli Bartsch merged patch set 2 04/01/22, 11:54