Issue Bug Closed

#45703method exec_foreign_table_where_query don't respect rootLevel

Stefan Froemken 02/21/13, 13:09 updated 10/24/17, 20:20

Description

Hello Core-Team,

I’m using the TCA tree feature for my own table. This table is defined as rootLevel = -1. That means you can set records of this table on rootPage and all other pages. But there is a problem in method exec_foreign_table_where_query. You wrote:

if ($rootLevel) {
    $queryParts = array(
        'SELECT' => self::getCommonSelectFields($foreign_table, $foreign_table . '.'),
        'FROM' => $foreign_table,
        'WHERE' => $foreign_table . '.*pid=0* ' . self::deleteClause($foreign_table) . ' ' . $wgolParts['WHERE'],
        'GROUPBY' => $wgolParts['GROUPBY'],
        'ORDERBY' => $wgolParts['ORDERBY'],
        'LIMIT' => $wgolParts['LIMIT']
    );
}

If rootLevel equals 1 this code works correct with pid=0. But it will also be executed with rootLevel=-1. But in that case pid=0 must be pid<>-1 or should be deleted completely.

Stefan

Reviews 4