[TYPO3-english] got cObj->IMAGE in backend to work, but ...

Thomas Appel appel at gmx.net
Mon Jan 17 18:46:19 CET 2011


Thanks, this is a good point.

Well, more than this, this is THE point.
Thought filemtime needs the exact full path to the file, but when it's called from the root of the relative filepath, it works. 

$GLOBALS['TSFE']->tmpl->getFileName_backPath is set to PATH_site but this doesn't solved anything.

I guess, I've got to digg a little bit deeper.

Thank you so much Björn.

Kind Regards, Thomas
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Thomas Appel | Dipl. Designer (FH) | phone: +49160 97979 694 | mail: appel at gmx.net



Am 17.01.2011 um 17:01 schrieb Bjoern Pedersen:

> Am 17.01.2011 16:47, schrieb Thomas Appel:
> 
>> The problem is, that, in my case, the conversion fails in class tslib_cObj at about line 5520:
>> 							$GLOBALS['TSFE']->tmpl->fileCache[$hash]['origFile'] = $theImage;
>> 							$GLOBALS['TSFE']->tmpl->fileCache[$hash]['origFile_mtime'] = @filemtime($theImage);
>> 
>> I can call my script from a "real" FE session an it works. debug($theImage) prints out the relative path to the image file ('uploads/pluginfolder/image.jpg') but gets validated in filemtime($theImage) (but why?).
>> Called from the backend $theImage prints put the same string (relative path) but filemtime($theImage) fails (which seems to me the more logical case). 
>                                                                ^^^^here
> That is your problem: FE runs from your website root, BE scripts run
> from root/typo3, so the relative path is wrong. There are API-functions
> to resolve the path, please check the docs.
> 
> Björn
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list