Project

General

Profile

Actions

Bug #19721

closed

enableFields doesn't work with boolean as parameter

Added by Michael Knabe over 15 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2008-12-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

9979.diff (1.11 KB) 9979.diff Administrator Admin, 2009-08-28 21:15
Actions #1

Updated by Michael Knabe over 14 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.

Actions #2

Updated by Alexander Opitz almost 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)?

Actions #3

Updated by Michael Knabe almost 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.

Actions #4

Updated by Chris topher almost 11 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF