3

I am using helhum File Upload Demo to upload the images. But currently i got below error.

Exception while property mapping at property path "images.0":Property "name" was not found in target object of type "XXXX\XXXXX\Domain\Model\FileReference 

Please help here.. How can i move forward.

Thanks in advace.

Vishal Tanna
  • 1,165
  • 2
  • 12
  • 36

2 Answers2

5

If you followed the example extension, you are maybe missing the registration of UploadedFileReferenceConverter and ObjectStorageConverter in your ext_localconf.php. Took me a day to find that one:

ext_localconf.php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter('Vendor\\EXT\\Property\\TypeConverter\\UploadedFileReferenceConverter');
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter('Vendor\\EXT\\Property\\TypeConverter\\ObjectStorageConverter');
The F
  • 3,647
  • 1
  • 20
  • 28
  • could you please mention that how can i upload multiple images in the example of this helum? currently if i define a multiple="multiple" then it does not work.... – zahid Jan 06 '17 at 07:40
0

In the initializeUpdateAction (or initializeCreateAction) you have to use the name of the parameter in the updateAction (or createAction) as argument.

If your updateAction looks like this:

public function updateAction(\Classname $yourObject)

You have to call the helhum function with the argument:

$this->setTypeConverterConfigurationForImageUpload('yourObject');

As a small hint for later problems: In the setTypeConverterConfigurationForImageUpload function you should register your own file attributes if they are not named image and/or imageCollection.0 like in the example.

luxer
  • 660
  • 5
  • 15