Actions
Feature #85378
openEXT:form option for saving uploaded file as sys_file_reference
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:
Needs Decision
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:
- Automatically performing an insert query on the sys_file_reference table with tablenames = <options.table> and fieldname = <options.elements.elementName>
- Skip both the setting of the field in <options.table> and the complete insert query for sys_file_reference
Actions