Project

General

Profile

Actions

Bug #93695

closed

Cannot override file upload mime-types completely

Added by Oliver Hader over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2021-03-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Remote Sprint

Description

Form element definition for FileUpload in typo3/sysext/form/Configuration/Yaml/FormElements/FileUpload.yaml contains

allowedMimeTypes:
  - application/msword
  - application/vnd.openxmlformats-officedocument.wordprocessingml.document
  - application/vnd.oasis.opendocument.text
  - application/pdf

My specific form definition at fileadmin/form_definitions/something.form.yaml overrides settings since I just expect plain-text or CSV uploads:

-
  properties:
    saveToFileMount: '1:/form_uploads/documents/'
    allowedMimeTypes:
      - text/plain
      - text/csv
    elementDescription: ''
  type: FileUpload
  identifier: fileupload-1
  label: Document

However, allowedMimeTypes items are not completely overridden, but merged instead - some mime-types of the initial form element definition are kept - for this example I get:

  - text/plain
  - text/csv
  - application/vnd.oasis.opendocument.text
  - application/pdf

This is caused in TYPO3\CMS\Form\Domain\Model\FormElements\AbstractFormElement::setProperty() which implicitly merges those values. From my point-of-view it's most probably not required to apply initial settings from typo3/sysext/form/Configuration/Yaml/FormElements/FileUpload.yaml at all - however, I did not check/verify that.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #90188: Re-implement strict mimetype validationClosed2020-01-24

Actions
Is duplicate of TYPO3 Core - Bug #92309: Missing feature flag processing/checkClosedMathias Brodala2020-09-15

Actions
Actions

Also available in: Atom PDF