[TYPO3-extbase] Try to inject ResourceFactory and got a "Call to a member function retrieveFileOrFolderObject() on a non-object" error.

Johan DEQUEANT jdequeant at w-seils.com
Tue Dec 15 16:10:54 CET 2015


I replace injection by annotation with injection by setter and this fix it :

 

/**

* @param \TYPO3\CMS\Core\Resource\ResourceFactory $resourceFactory

*/

public function injectResourceFactory(
\TYPO3\CMS\Core\Resource\ResourceFactory $resourceFactory ){

                $this->resourceFactory = $resourceFactory;

}

 

De : Johan DEQUEANT [mailto:jdequeant at w-seils.com] 
Envoyé : mardi 15 décembre 2015 14:22
À : 'typo3-team-extbase at lists.typo3.org'
Objet : Try to inject ResourceFactory and got a "Call to a member function
retrieveFileOrFolderObject() on a non-object" error.

 

Hi !

 

I try to implement file upload in an extbase extension like this :
https://github.com/helhum/upload_example but I got this error : 

« Call to a member function retrieveFileOrFolderObject() on a non-object in

/Classes/Property/TypeConverter/UploadedFileReferenceConverter.php on line
188 »

 

At the line 188 in UploadedFileReferenceConverter : 

 

$uploadFolder =
$this->resourceFactory->retrieveFileOrFolderObject($uploadFolderId);

 

I think that this part of code doesn’t work :

 

/**

* @var \TYPO3\CMS\Core\Resource\ResourceFactory

* @inject

*/

protected $resourceFactory;

 

Have you an idea why the ResourceFactory is not correctly injected ?

 

Thanks !!

 

Johan DEQUEANT

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.typo3.org/pipermail/typo3-team-extbase/attachments/20151215/812d4583/attachment.htm>


More information about the TYPO3-team-extbase mailing list