Project

General

Profile

Actions

Bug #70468

closed

PropertyMapper cant't create object of type TYPO3\\CMS\\Core\\Resource\\Folder

Added by Markus Hofmann about 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-10-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

In case of using frontend upload in an extbase, I use the storage for saving the uploaded files.
While trying to create the needed folder for using $storage->addFile() the properyMapper throws exeption

#1297759968: Exception while property mapping at property path "":Property "identifier" had no setter or constructor argument in target object of type "TYPO3\CMS\Core\Resource\Folder" 

Following code does this error:

$folderType = array(
     'storage' => $storage,
    'identifier' => $mountpoint->getPath(),
    'name' => $mountpoint->getTitle()
);
/** @var \TYPO3\CMS\Core\Resource\Folder $folder */
$folder = $this->propertyMapper->convert($folderType,'TYPO3\\CMS\\Core\\Resource\\Folder');

Creating the object with "new" and assigning the parameters to the constructor does the thing correct and uploads the files to the specified folder.
My current Typo3 is 7.5

Actions #1

Updated by Mathias Brodala over 6 years ago

  • Status changed from New to Needs Feedback

Can you please add more details how exactly the upload was implemented. See the following for a working example:

https://github.com/helhum/upload_example

Actions #2

Updated by Markus Hofmann over 6 years ago

Could get closed, problem was, two years ago there was no documentation found by me, so I wrote it another way. Works for me, newer projects are built other way. Thanks for your request

Actions #3

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Needs Feedback to Closed

@Markus Hofmann thank you for your feedback; I close this one for now. Feel free to reopen it if you think that this is the wrong decision or there is still something that should be done (or ping me and I'll do).

Actions

Also available in: Atom PDF