[TYPO3-core] RFC #9979: Bug: enableFields doesn't work with boolean as parameter

Michael Knabe t3 at aafhh.de
Wed Dec 9 01:25:07 CET 2009


Hi,
I know you had a lot of stress with the release of 4.3. But hopefully
you had enough time to relax now. So this is
Reminder #1

Michael Knabe schrieb:
> This is an SVN patch request.
> 
> Type: Bugfix
> 
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=9979
> 
> Branch: Trunk
> 
> Problem:
> According to typo3conf/ext/t3dev/apidocs/tslib_content_api.html
> the method enableFields expects a boolean as the second parameter
> ($show_hidden) but only integers lead to the desired result.
> enableFields($table, TRUE) does not work correctly while
> enableFields($table, 1) does.
> The reason is found in t3lib_pageSelect::enableFields(), where -1 is
> used as the default value for $show_hidden. That default value means
> "look in $GLOBALS['TSFE']->showHiddenRecords for the real $show_hidden
> value" . The problem is, how $show_hidden is tested for -1:
> "$show_hidden==-1" evaluates to TRUE for $show_hidden===TRUE.
> 
> Solution:
> Change the comparison to identity (===)
> 
> Cheers,
> Michael
> 


More information about the TYPO3-team-core mailing list