[TYPO3-mvc] Adding new records does not consider newRecordStoragePid

Dirk Rauscher dr_typo3 at itb-institut.de
Mon Aug 22 11:08:34 CEST 2011


Hey Franz,

thanks for your explanation and the hint about the thing to better use 
the objectManager instead of t3lib_div::makeInstance.
Now it works as expected...

Cheers, Dirk



Am 17.08.2011 13:05, schrieb Franz Koch:
> Hey Dirk,
>
>> $bs = t3lib_div::makeInstance('Tx_Extbase_Core_Bootstrap');
>> $bs->initialize($GLOBALS['TSFE']->tmpl->setup['tt_content.']['list.']['20.']['itbmemento_pi1.']);
>>
> ...
>> It took me some time to find out how it works...
>> Is there an more correct way to let the configurationManager know in
>> which extensions context the method call is done?
>
> no, this one is fine. If the action you're triggering is registered for
> the according plugin, you could also do a $boostrap->run() with
> according parameters.
>
> Please note that as of Extbase 1.3 you should no longer use
> t3lib_makeInstance to instantiate classes of Extbase based extensions,
> because you'll loose dependency injection and therefore things are
> likely to fail. So in your case you would first create a instance of the
> objectManager via t3lib_div::makeInstance and use it to fetch your
> repository object and whatever else you like to do outside your
> controllers etc. (the bootstrap and of course the objectManager are the
> only objects where you need t3lib_div::makeInstance)



More information about the TYPO3-project-typo3v4mvc mailing list