Bug #19721
closedenableFields doesn't work with boolean as parameter
0%
Description
According to typo3conf/ext/t3dev/apidocs/tslib_content_api.html the method enableFields expects a boolean as the second parameter ($show_hidden), but if I give TRUE as $show_hidden, I don't get the expected result. However, if I give 1 it works.
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: "if($show_hidden==-1)" is true for $show_hidden=TRUE.
This check should either be changed to "if($show_hidden===-1)" or the documentation has to be changed.
(issue imported from #M9979)
Files
Updated by Michael Knabe almost 15 years ago
Martin Kutschker wrote on the mailinglist:
The default value of -1 clearly shows that the argument is not a boolean. So the docs aare wrong,
not the code.
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0)
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Michael Knabe over 11 years ago
As far as I am concerned this issue can be closed, as this emerged as an issue in the documentation and t3dev seems to be abandoned anyway.
I just had a quick look into the function comment (in master) and that clearly states that the field is an integer. I didn't look into the 4.5 branch but I don't think the comment has to be backported anyhow.
Updated by Chris topher over 11 years ago
- Status changed from Needs Feedback to Closed