[TYPO3-dev] processDatamap_afterDatabaseOperations called twice?

Bjoern Pedersen pedersen at resi2.office.frm2
Tue Sep 22 13:42:16 CEST 2009


Christian Tauscher <christian.tauscher at media-distillery.de> writes:

> I have installed now EXT:devlog by Rene Fritz and Francois
> Suter. Great Tool, why didn't  I use this earlyer? Much better than
> only debug().
>
>
> Back to business:
>
> The logfile says The hook is calles twice. Why?
>
> It has something to do with IRRE I use.
>
> Sure, you will say - the reason!
>
> But:
> In my function I do a explicit test for my table. If the child tables
> are called (for what reason ever), nothing happens.
>
>
> The Point is:
>
> I have 2 IRRE Records. If I comment out all of them in TCA, one mail
> is sent as expected.
>
> If I comment out only one of the IRREs, one mail is sent- good.
>
> Change back to my two IRREs, two mails are sent - bad.
>
> now the test:
>
> Create a new IRRE field.
> So there are three 3 IRREs, ans also 3 Mails are sent - very bad.
>
>
>
> So the rule is: Conclusion:
> 1 mail for the master record (correct)
> and n-1 mails for n IRREs (wrong)
>
> So this seems to be the reason: IRRE.
>
> I must find a way tho know If my hook is called recursively again by IRRE.
>
> Who knows a way to achive this?
> Maybe I could define a global counter variable to check more calls,
> but is this good behavior? If  I do so, is there a namespace for such
> things?
>
> Thank you,
>
> Christian.

Maybe you should use this hook instead, your hook can get called
multiple times due to processRemapStack.


		 * Hook: processDatamap_afterAllOperations
		 *
		 * Note: When this hook gets called, all operations on the submitted data have been finished.
		 */
		foreach($hookObjectsArr as $hookObj) {
			if (method_exists($hookObj, 'processDatamap_afterAllOperations')) {
				$hookObj->processDatamap_afterAllOperations($this);
			}
		}




More information about the TYPO3-dev mailing list