Bug #88238

Updated by Ralf Zimmermann 6 months ago

The ext:form setup contains some predefined mime types for the elements "FileUpload" and "ImageUpload"

* https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Configuration/Yaml/BaseSetup.yaml#L254
* https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Configuration/Yaml/BaseSetup.yaml#L260

Such predefined values are used as starting values while the form element is factorized:

* https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Classes/Domain/Factory/ArrayFormFactory.php#L104
* https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Classes/Domain/Model/FormElements/AbstractSection.php#L138

later on, the values from the form definition will be overlayed (https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Classes/Domain/Model/FormElements/AbstractFormElement.php#L148):

* https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Classes/Domain/Factory/ArrayFormFactory.php#L119

A form definition like this

<pre>
type: Form
identifier: test-1
label: test
prototypeName: standard
renderables:
-
type: Page
identifier: page-1
label: Step
renderables:
-
type: FileUpload
identifier: fileupload-1
label: 'File upload'
properties:
saveToFileMount: '1:/user_upload/'
allowedMimeTypes:
- application/pdf
</pre>

ends up in with the default ext:form setup, the result is a form element like this

<pre>
type: FileUpload
identifier: fileupload-1
label: 'File upload'
properties:
saveToFileMount: '1:/user_upload/'
allowedMimeTypes:
- application/msword
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
- application/vnd.oasis.opendocument.text
- application/pdf
</pre>

We need to remove the predefined mime types from the ext:form setup-

Back