[BUGFIX] Allow persisting PseudoFileReference via database form finisher
authorOliver Hader <oliver@typo3.org>
Tue, 18 May 2021 14:09:38 +0000 (16:09 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 18 May 2021 19:43:30 +0000 (21:43 +0200)
To "encapsulate" resources that were uploaded using a form element, a
new PseudoFileReference class was introduced in TYPO3-CORE-SA-2021-002,
extending Extbase's FileReference domain model.

When trying to persist those files using Extbase's PersistenceManager,
the corresponding database table is assumed to be (inferred from class)
`tx_form_mvc_property_typeconverter_pseudofilereference` instead of
correct `sys_file_reference`.

In order to solve this issue, a corresponding mapping for the new domain
model is introduced.

Resolves: #94153
Releases: master, 10.4, 9.5
Change-Id: I8325a5c78e1e2e37ff75711a10725be796c22d9d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69176
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/form/Configuration/Extbase/Persistence/Classes.php [new file with mode: 0644]

diff --git a/typo3/sysext/form/Configuration/Extbase/Persistence/Classes.php b/typo3/sysext/form/Configuration/Extbase/Persistence/Classes.php
new file mode 100644 (file)
index 0000000..cb64483
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+
+declare(strict_types=1);
+
+return [
+    \TYPO3\CMS\Form\Mvc\Property\TypeConverter\PseudoFileReference::class => [
+        'tableName' => 'sys_file_reference',
+    ],
+];