[TYPO3-mvc] Error handling for db requests?
Pankaj Lele
pankaj at lelesys.com
Mon Oct 10 13:08:29 CEST 2011
> The error handling of db requests sometimes drives me crazy...
>
> As an example I simply want to get all records from a table: (Strangely, I have _exactly_ the same code working inside another action)
> $this->themenschwerpunktRepository = t3lib_div::makeInstance('Tx_Extensionname_Domain_Repository_ThemenschwerpunktRepository');
> $this->view->assign('themenschwerpunkte', $this->themenschwerpunktRepository->findAll());
>
> No values are assigned. No I want to debug the output and try the following:
> var_dump($this->themenschwerpunktRepository->findAll());
> or
> <f:debug>{themenschwerpunkte}</f:debug>
>
> Both ways lead to a blank page without any errors. (Status 200 OK).
This happens because there must be a PHP error of Memory or script timeout.
This happens all the time when you var_dump() or print_r() any object
from the Extbase.
You can go to server's error.log and see.
> Error reporting etc. is all configured in the Install Tool. But these settings do not seem to work for extbases persistence layer.
>
> Here my two Actions:
> http://pastebin.com/nRQ7uZYJ
>
> I can't figure out, why the same code seems to work fine in one action, but leads to no found objects in the other actions. (and is not debuggable)
Maybe first try with using the Dependency Injection (DI) instead of
makeInstance for repositories. Then check if you have correctly set the
PID either in the constants or plugin content element's Starting point
field.
--
With best regards,
Pankaj Lele
---------------------------
CTO & Executive Director
Lelesys Infotech Pvt. Ltd.
Pune/Goa, India
Web: http://www.lelesys.com
[Certified TYPO3 Integrator]
More information about the TYPO3-project-typo3v4mvc
mailing list