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

Dmitry Dulepov [typo3] dmitry at typo3.org
Fri Jan 18 14:44:03 CET 2008


Hi Stefan!

First minor advice: please, make patches over TYPO3 root directory (this is where t3lib and typo3 are located). In your patch:

> --- class.tslib_content.php	(revision 2922)
> +++ class.tslib_content.php	(working copy)

which means that patch is made over typo3/sysext/cms. Normally, the person, who applies the patch, just apply it to of TYPO3 and see how it works. It just more convinient when there is a common point where all patches start.

Stefan Geith wrote:
> 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)

Good idea, +1 by code review. I would only add a hint to modern IDEs about variable type. See attachment.

-- 
Dmitry Dulepov
TYPO3 core team
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"Nothing is impossible. There are only limits to our knowledge"
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0007203_tslib_content_hook.patch
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080118/5dda50c9/attachment.txt 


More information about the TYPO3-team-core mailing list