Bug #17577
closedenableFields() not called in some cases
0%
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)