97605[BUGFIX] Respect TSconfig allowed/disallowed for TCA type file
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 2
Review log 910
-
Benni Mack uploaded patch set 1 11/13/26, 10:30
-
core-ci voted on patch set 1 V +1 11/13/26, 10:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114304
-
Garvin Hicking voted on patch set 1 CR +1 V +1 11/13/26, 10:59
-
Oli Bartsch commented on patch set 1 V -1 11/13/26, 16:39
TcaFiles.php:131TCA values go through `TcaPreparation::prepareFileExtensions()`, which resolves `common-image-types` and friends, but TSconfig values are copied raw. `allowed = common-image-types` would then allow only that literal string, so nothing can be selected or uploaded.TcaFiles.php:132This wont work that way. This completely replace the TCA values so an empty `allowed` or extra extensions lift the TCA restriction. On save, DataHandler filters against the TCA config and silently deletes the `sys_file_reference` for files TCA forbids, so editors can select a file and lose it without any message. -
Benni Mack uploaded patch set 2
CR +1V +111/13/26, 19:17 -
Benni Mack commented on patch set 1 11/13/26, 19:17
TcaFiles.php:121ReplyTSconfig can now only narrow the TCA restriction, never widen it, so it stays a FormEngine-level refinement like other TCEFORM options.TcaFiles.php:131ReplyDone.TcaFiles.php:132ReplyDone. -
Benni Mack commented on patch set 1 11/13/26, 19:18
TcaFiles.php:121Replywell, the question is if we forgot about that one or we did that intentionally back then in v12 when we built type=file. I don't know anymore. But the persistence issue is real indeed (unfortunately), however I can see to limit uploads / file endpoints to just a certain file type. -
Oli Bartsch commented on patch set 2 11/14/26, 10:23
TcaFiles.php:121ReplyI'm not convinced we should add this tbh. Having a option which is not respected by DataHandler makes IMO no sense. One can just send e.g. via ajax and circumvent this narrowed config. -
Benni Mack commented on patch set 2 11/14/26, 17:17
TcaFiles.php:121Replyyou are right, if we do this, we should do it right, and need to work on the DataHandler side - making this a feature. abandoning this change now. -
Benni Mack abandoned the change 11/14/26, 17:17
TcaFiles.php:121