[TYPO3-core] RFC: Bug #7203: Hook cObjTypeAndClassDefault in tslib_content somtimes fails

Steffen Kamper info at sk-typo3.de
Fri Jan 18 15:38:34 CET 2008


"Oliver Hader" <oh at inpublica.de> schrieb im Newsbeitrag 
news:mailman.1.1200664440.17130.typo3-team-core at lists.netfielders.de...
> Hi Stefan,
>
> Stefan Geith schrieb:
>> This is a SVN patch request.
>>
>> Problem:
>> Hook cObjTypeAndClassDefault in tslib_content is sometimes called, even 
>> if $conf-Array is empty or $name is empty.
>> This causes an error if you use this hook, because the interface needs 
>> $conf to be an array.
>> This hook was introduced by patch from 
>> http://bugs.typo3.org/view.php?id=5536
>>
>> Solution:
>> Solution: check on (is_array($conf) && $name)
>>
>> Bugtracker references:
>> http://bugs.typo3.org/view.php?id=7203
>>
>> Branches: Trunk
>
> Good idea to change this, thanks for your patch!
> But I have some annotations:
> * the check against $name is fine with me
> * the is_array() check not
>
> The following TypoScript won't work then with the hook:
> 10 = COA
> 10 {
>   10 = MYOWNSTATICBLOCK
> }
>
> So i tend to check at the beginning of cObjGetSingle() if $conf is an 
> array and if not create an empty array.
>
> olly
> -- 
> Oliver Hader
> http://inpublica.de/

why not casting it to array ?
(array) $conf

vg  Steffen 




More information about the TYPO3-team-core mailing list