Project

General

Profile

Actions

Feature #85378

open

EXT:form option for saving uploaded file as sys_file_reference

Added by Lidia Demin almost 6 years ago. Updated about 4 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2018-06-25
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

In #85216 we discovered two problems:
  • The description how to save an uploaded file as sys_file_reference is missing.
  • If the file field isn't mandatory and therefore empty the insert query for the sys_file_reference table throws an exception.

For the second problem the suggestion was to use a custom SaveToDatabase finisher.

I think this whole thing should be easier, especially because there are only two fields that need to be configured for the sys_file_reference table. The configuration could look something like this:

finishers:
  -
    identifier: SaveToDatabase
    options:
      table: 'tx_myext_domain_model_mymodel'
      mode:  'insert'
      elements:
        logo:
          mapOnDatabaseColumn: 'logo'
          saveAsFileReference: true
          skipIfValueIsEmpty: true

The SaveToDatabaseFinisher needs to be extended to look for those options and:
  1. Automatically performing an insert query on the sys_file_reference table with tablenames = <options.table> and fieldname = <options.elements.elementName>
  2. Skip both the setting of the field in <options.table> and the complete insert query for sys_file_reference

Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Bug #85772: EXT:form SaveToDatabaseFinisher cannot handle multi value fieldsNew2018-08-07

Actions
Copied from TYPO3 Core - Task #85216: EXT:form SaveToDatabase Finisher saves files as sys_file, not as sys_file_referenceClosed2018-06-11

Actions
Actions

Also available in: Atom PDF