[TYPO3-dev] Problem fetching FAL-FileReference via Extbase

Helmut Hummel helmut.hummel at typo3.org
Sat Jul 27 16:00:11 CEST 2013


Hi,

On 26.07.13 13:08, Michael Bakonyi wrote:

> I double-checked my configuration of model, TCA etc. but in the frontend
> the property "originalResource" is always "NULL". So I can't access all
> the properties of my file to build the download-link for example. All
> other properties (uid, fileRepository, pid etc.) of the reference are
> present.

How do you access these protected properties?

> I shortly had a look at the model
> \TYPO3\CMS\Extbase\Domain\Model\FileReference and there is the function
> "getOriginalResource" which handles exact this case (if originalResource
> is NULL) but it seems like this function never gets called.

The only thing you need to do is call the getter for the 
originalResource. If you use the object in a Fluid template, Fluid does 
that for you automatically.

> Is this a bug or do I have to initiate this function somewhere in my
> extension?

It may be a bug, if you can tell me a way to access the protected 
property of the FileReference object which is supported.

If you use a subclass of FileReference it would of course work to access 
the property, but that does not work because it is only populated, once 
the getter is called. So we might change this property to be private 
instead of protected to force subclasses to use the getter instead.

Kind regards,
Helmut

-- 
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 Core Developer, TYPO3 Security Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org



More information about the TYPO3-dev mailing list