[TYPO3-mvc] Tx_Extbase_Dispatcher from hook in tslib_fe

Kevin Ulrich Moschallski km at 3digit.de
Thu Jul 8 16:02:59 CEST 2010


Hi Franz,

thank you very much works like a charm.

Regards,

Kevin

Am 08.07.2010 um 15:32 schrieb Franz Koch:

> Hi,
> 
>> The error is:
>> 
>> #1: PHP Catchable Fatal Error: Argument 1 passed to Tx_Extbase_Configuration_FrontendConfigurationManager::setContentObject() must be an instance of tslib_cObj, null given, called in /Applications/MAMP/htdocs/dev/typo3conf/ext/extbase/Classes/Dispatcher.php on line 178 and defined in /Applications/MAMP/htdocs/dev/typo3conf/ext/extbase/Classes/Configuration/FrontendConfigurationManager.php line 45
>> 
>> setContentObject() complains that the given argument is not an instance of tslib_cObj, but when i do a var_dump on the object in the method (after removing the validation) it show up as an instanc of tslib_cobj.
>> 
>> My question now is, if anybody here ever tried this before or has an idea why the object isn't recognized correctly. Or maybe somebody has an different approach to what i'm trying to to.
> 
> Having a look at the according line 178 you would have noticed, that "$this->cObj" is passed to setContentObject, but $this->cObj is in your case NULL. The first argument of the dispatch method is NOT the cObject. The cObject is set from the outside by TYPO3 by default. So try this:
> 
> $d = new Tx_Extbase_Dispatcher;
> $d->cObj = $feobj->content;
> $d->dispatch($feobj->content->data, $conf);
> 
> 
> -- 
> kind regards,
> Franz Koch
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list