Project

General

Profile

Feature #16994 » bug_5001.diff

Administrator Admin, 2007-03-06 07:31

View differences:

class.t3lib_befunc.php 2007-03-06 07:25:30.000000000 +0100
// rootLevel = -1 is not handled 'properly' here - it goes as if it was rootLevel = 1 (that is pid=0)
$wgolParts = $GLOBALS['TYPO3_DB']->splitGroupOrderLimit($fTWHERE);
// look for additional tables
$tablesArr = array($foreign_table);
$allTables = is_set($fieldValue['config'][$prefix.'foreign_table_additional'])?$fieldValue['config'][$prefix.'foreign_table_additional']:'';
$additional_tables = explode(',', $allTables);
if (!$rootLevel && $foreign_table != 'pages') {
foreach ($additional_tables as $i => $table) {
if (substr_count($table, 'pages') > 0) {
unset($additional_tables[$i]);
}
}
$tablesArr[] = 'pages';
}
$tablesArr = array_unique(array_merge($tablesArr, $additional_tables));
$tables = implode(',', $tablesArr);
if ($rootLevel) {
$queryParts = array(
'SELECT' => t3lib_BEfunc::getCommonSelectFields($foreign_table,$foreign_table.'.'),
'FROM' => $foreign_table,
'FROM' => $tables,
'WHERE' => $foreign_table.'.pid=0 '.
t3lib_BEfunc::deleteClause($foreign_table).' '.
$wgolParts['WHERE'],
......
if ($foreign_table!='pages') {
$queryParts = array(
'SELECT' => t3lib_BEfunc::getCommonSelectFields($foreign_table,$foreign_table.'.'),
'FROM' => $foreign_table.',pages',
'FROM' => $tables,
'WHERE' => 'pages.uid='.$foreign_table.'.pid
AND pages.deleted=0 '.
t3lib_BEfunc::deleteClause($foreign_table).
......
} else {
$queryParts = array(
'SELECT' => t3lib_BEfunc::getCommonSelectFields($foreign_table,$foreign_table.'.'),
'FROM' => 'pages',
'FROM' => $tables,
'WHERE' => 'pages.deleted=0
AND '.$pageClause.' '.
$wgolParts['WHERE'],
(4-4/4)