[TYPO3-dev] stdWrap hooks - problem in 4.5

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Feb 7 17:44:12 CET 2011


Maximilian Kalus schrieb am 07.02.2011 17:42:
> I can also copy the problems of Marcus. Having studied the code in
> class.tslib_content.php, I am not quite sure how "new" hooks are
> supposed to work.
> 
> The method Joey and Jigal described does not work, as far as I see. I
> can manipulate $stdWrapOrder in the stdWrapPreProcess hook, but in line
> 2047, $this->$functionName is called. So just adding a function won't
> work.
> 
> Well, in line 2036, there is an if that queries $conf[$functionName]  ==
> 'stdWrapHookObject'. What is this for? Hunting for this obscure string,
> I found that some of the original discussions in bugs.typo3.org
> regarding "Optimize stdWrap" defined the strings in the configuration of
> hooks arount line 1974:
> 
> foreach ($this->stdWrapHookObjects as $hookObject) {
> 	if (is_callable(array($hookObject, 'stdWrapPreProcess'))) {
> 		$conf['stdWrapPreProcess'] = 'stdWrapHookObject';
> 	}
> 	;
> 	if (is_callable(array($hookObject, 'stdWrapOverride'))) {
> 		$conf['stdWrapOverride'] = 'stdWrapHookObject';
> 	}
> 	;
> 	if (is_callable(array($hookObject, 'stdWrapProcess'))) {
> 		$conf['stdWrapProcess'] = 'stdWrapHookObject';
> 	}
> 	;
> 	if (is_callable(array($hookObject, 'stdWrapPostProcess'))) {
> 		$conf['stdWrapPostProcess'] = 'stdWrapHookObject';
> 	}
> 	;
> }
> 
> 
> In the 4.5.0 release, the are assigned the value 1 instead of
> 'stdWrapHookObject' in each of the four lines. Having not followed the
> development, I guess there is a good reason for this.But if I change the
> 1 to 'stdWrapHookObject', my hooks start working again, because line
> 2037 assigns $singleConf correctly again.
> 
> Is this a bug or a feature, I have not grasped correctly yet?

Thanks for investigating! This is the bug I just mentioned in my
previous post (to the original thread). I also consider it important to
get fixed in 4.5.1 (maintaining backwards compatibility).

If you found a fix which works, it sounds pretty good, and you might
post it as an RFC to the core list, so that more people can review it.

Cheers,
Ernesto





More information about the TYPO3-dev mailing list