Project

General

Profile

Actions

Bug #17577

closed

enableFields() not called in some cases

Added by Guillaume Crico about 17 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2007-09-04
Due date:
% Done:

0%

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

Description

I discovered this bug using the "addEnableColumns" hook on "pages" table.
In some cases custom filters are not applied (ex: HMENU-special-directory rendering)...

In "tslib_cObj::getWhere()", we have :

// enablefields
if ($table=='pages') {
$query.=' '.$GLOBALS['TSFE']->sys_page->where_hid_del.
$GLOBALS['TSFE']->sys_page->where_groupAccess;
} else {
$query.=$this->enableFields($table);
}

that sould be :

$query.=$this->enableFields($table);

Note that tslib_cObj::enableFields() applies the "$GLOBALS['TSFE']->showHiddenRecords" setting automaticallly, so I'm nearly sure that it will work...

The question is "Why a special case for 'pages' in getWhere() ?".
I think the author thought about performances (sys_page->where_hid_del + sys_page->where_groupAccess looks like a "faster" enableFields() call)...
If we need performances, we can implement a lightweight cache in t3lib_pageSelect::enableFields() method, using a static hash var per example...

Anyway, I don't think it's a good idea to skip "enableFields" in any case.
It is a typo3 foundation, that cannot accept "holes"...

--- /usr/local/typo3/typo3_src-4.1.2/typo3/sysext/cms/tslib/class.tslib_content.php Mon Jul 16 01:31:30 2007
+++ /home/gco/fixes/typo3_src-4.1.2/typo3/sysext/cms/tslib/class.tslib_content.php Tue Sep 04 10:47:49 2007
@ -6699,12 +6699,7 @
}

// enablefields
- if ($table=='pages') {
- $query.=' '.$GLOBALS['TSFE']->sys_page->where_hid_del.
- $GLOBALS['TSFE']->sys_page->where_groupAccess;
- } else {
- $query.=$this->enableFields($table);
- }
+ $query.=$this->enableFields($table);
// MAKE WHERE:
if ($query) {

(issue imported from #M6254)

Actions

Also available in: Atom PDF