Project

General

Profile

Actions

Bug #20449

closed

Mapping in query does not takes care of remapping "table.field" in a WHERE clause

Added by Xavier Perseguers over 15 years ago. Updated about 15 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2009-05-18
Due date:
% Done:

0%

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

Description

When remapping name of table X, any query selecting data from table Y and having a WHERE condition on some field of table X won't get the name of table X remapped.

E.g. when using TemplaVoila with Oracle, one has to remap a table to prevent name length overflow:

$TYPO3_CONF_VARS['EXTCONF']['dbal']['mapping'] = array(
'tx_templavoila_datastructure' => array(
'mapTableName' => 'tx_templavoila_ds',
),
);

Any query selecting data on tx_templavoila_datastructure is in fact issued on table tx_templavoila_ds when accessing the database.

But if we edit a page, a query is issued on table pages with a condition on a field of tx_templavoila_datastructure in the "value" part of the comparison:

SELECT * FROM pages WHERE pages.uid = tx_templavoila_datastructure.pid

The current implementation of the mapping is not able to remap a table and a field name in the value part of the comparison, it handles a "table + field" value definitition but only remap the field part.

Solution:
Do not assume that the table name for the value part is the table used in the "FROM" part of the query and map both table and field names if needed.

(issue imported from #M11119)


Files

11119.diff (1.82 KB) 11119.diff Administrator Admin, 2009-05-18 14:49
Actions #1

Updated by Martin Kutschker over 15 years ago

At revision: 5594

Actions

Also available in: Atom PDF