[TYPO3-mvc] Using repositories in eID script

Frank Gerards F.Gerards at esolut.de
Wed Oct 10 14:20:06 CEST 2012


Hi,

my approach to Extbase and AJAX is a little different.
I wrote an AJAX Dispatcher class, which bootstraps extbase and any given object/controller combination, returning the result as json. It was a bit in a hurry, so its not that abstract, but I use this principle in all our TYPO3 AJAX Extensions since then and it works performant and great.

See here: http://pastebin.com/rstMP9KK

H2HH,
Frank


-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Felix Nagel
Gesendet: Mittwoch, 10. Oktober 2012 12:54
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: Re: [TYPO3-mvc] Using repositories in eID script

Am 10.10.2012 11:35, schrieb Claus Due:
>>> Did you check the usual TS pitfalls that could cause framework/plugin configuration to not be available? Include/set in all root templates.
>> Whayt exactly do you think of? StoragePid is set, anything else? Im not sure if this is relevant as the eID is not aware of the TS, isnt it?
>
> TS contains the mapping instructions as well as storagePid for your extension - it's highly relevant even in eID mode (unfortunately).
>
> Since eID does not necessarily use a page ID, you should ensure that TS is available from all root templates (since Extbase will use the first added root ts template as fallback - and this is almost certain to happen since you don't have any connection to a cObj which is what ConfigurationManager usually would read in order to detect pid).
>
> That's what exactly I'm thinking about :)

Any idea how to make the TS available? Its set on the root page but not recognized.

Ive tried using something like this:

private function loadTS($pageUid = 0) {
	$sysPageObj = t3lib_div::makeInstance('t3lib_pageSelect');
	$rootLine = $sysPageObj->getRootLine($pageUid);
	$TSObj = t3lib_div::makeInstance('t3lib_tsparser_ext');
	$TSObj->tt_track = 0;
	$TSObj->init();
	$TSObj->runThroughTemplates($rootLine);
	$TSObj->generateConfig();
	return $TSObj->setup;
}

but I have no idea where to save this configuration in order extbase will recognize it or at least storagePid of my extension.


After some more testing I've found my problem, at least when not using 
propertyMapper but setXyz methods.

Problem was my own getBy method in the repository class. It was missing 
getFirst() so the return value was a single object but a 
QueryResultInterface  object. Stupid little me.

The problem that there is no storagePid available still persists but 
using setPid manually works quite nice.


>>> Another dumb question, are there any hints in the error log (and devlog too, recommend you enable that)
>> No nothing. It just fails silently.
>
> That, on the other hand, is NOT so good.
>
> No PHP fatal warnings or similar in the web server log? These will help - but check the very first item in this email, it sounds like a probable cause.

For me this is typical extbase problem. Debugging and logging is always 
a nightmare. Ever tried to debug a extbase scheduler task 
(commandController)?





Thanks for your help again!

-- 
Regards
Felix Nagel


_______________________________________________
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