[TYPO3-core] RFC #17507: Extension using stdWrap hooks are broken due to stdWrap refactoring
Ernesto Baschny [cron IT]
ernst at cron-it.de
Tue Feb 8 09:03:10 CET 2011
Hi,
since this is not my patch, +1 by reading and testing.
It has already been tested by other people which reported that problem,
and reviewed by Jigal and Joey.
So I kindly ask Jigal to go ahead and commit to trunk and TYPO3 4.5.
Thanks!
Cheers,
Ernesto
Ernesto Baschny [cron IT] schrieb am 08.02.2011 09:02:
> Hi,
>
> This is a SVN patch request.
>
> Type: Bugfix
>
> BT reference: http://bugs.typo3.org/view.php?id=17507
>
> Branches: trunk, TYPO3_4-5
>
> Problem:
> See also the discussion about it in the dev list ("stdWrap hooks -
> problem in 4.5", e.g. EXT "ogonki".
>
> The problem is that the $configuration variable passed to the hook
> methods is not available anymore as it used to be in 4.4:
>
> function stdWrapProcess($content, array $configuration, tslib_cObj
> &$parentObject) {
> debug($configuration);
> return $content;
> }
>
> Debug returns only an array:
>
> stdWrapProcess 1
> stdWrapProcess.
>
> This breaks all extensions that use this hooks.
>
> Solution:
> The problem is in the way how tslib_content handles the $conf array. It
> is intersected with an array of availabl stdWrap functions and then
> handed over to these functions.
>
> This should not be the case with any stdWrap hook and actually it was
> intended to hand over the original $conf array to these functions, which
> unfortunately doesn't happen with the current code.
>
> Attached is a solution that replaces as check for the non existant value
> "stdWrapHookObjects" with a check for the function type "hook".
>
> How to test:
> Install "mak_stdwrapextended". Test this TypoScript (".md5=1" and
> ".listWrap=rand" provided by this extension):
>
> page {
> 1 = TEXT
> 1.wrap = <h1>|</h1>
> 1.value = joh316
> 1.stdWrap.md5 = 1
>
> 2 = TEXT
> 2.wrap = <h1>|</h1>
> 2.value = 1,2,3,4,5,6,7,8,9
> 2.stdWrap.listNum = rand
> 2.stdWrap.listNum.splitChar = ,
> }
>
> Works only after the patch.
>
> Notes:
> Patch is a co-work by Jigal and Joey.
More information about the TYPO3-team-core
mailing list