Skip to content

Commit 161a11d

Browse files
Property Exception while mapping file upload (#189)
* Property Exception while mapping file upload * Update Documentation/Exceptions/1297759968.rst Co-authored-by: Garvin Hicking <[email protected]> * Apply suggestions from code review --------- Co-authored-by: Garvin Hicking <[email protected]>
1 parent d0ae063 commit 161a11d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Documentation/Exceptions/1297759968.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,35 @@ TYPO3 Exception 1297759968
66

77
.. include:: /If-you-encounter-this-exception.rst.txt
88

9+
.. contents::
10+
11+
When using Extbase FileUpload, TYPO3 13.4.17
12+
============================================
13+
14+
.. warning::
15+
Exception while property mapping at property path "": Expected argument of type
16+
"TYPO3\CMS\Extbase\Domain\Model\FileReference", "TYPO3\CMS\Core\Http\UploadedFile"
17+
given at property path "documents".
18+
19+
The import for the PHP Attribute was missing
20+
21+
.. code-block:: diff
22+
:caption: packages/MyExtension/Classes/Domain/Model/MyModel.php
23+
24+
+use TYPO3\CMS\Extbase\Annotation\FileUpload;
25+
26+
#[FileUpload([
27+
'validation' => [
28+
'minFiles' => 0,
29+
'maxFiles' => 1,
30+
'mimeType' => ['allowedMimeTypes' => ['application/pdf']],
31+
],
32+
'uploadFolder' => '2:/documents/',
33+
])]
34+
protected ?FileReference $documents = null;
35+
36+
Adding the proper import to properly utilize the attribute will then also properly allow introspection of the PropertyMapper later on.
37+
938
Exception while property mapping at property path "":Object with identity "1" not found.
1039
========================================================================================
1140

0 commit comments

Comments
 (0)