Project

General

Profile

Actions

Feature #16994

closed

TCA: not possible to select over multiple tables

Added by Joerg Schoppet almost 18 years ago. Updated over 11 years ago.

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

0%

Estimated time:
PHP Version:
5.0
Tags:
Complexity:
Sprint Focus:

Description

If you make a TCA-entry for "select" or "group" and define a 'foreign_table' it is not possible to make a where-statement over multiple tables.

e.g.

you have a table 'tx_test_main', which has a field 'users'. This field is configured as a MM-relation to 'tx_test_year_user', so that you can add users to such a record.

Now you have a table 'tx_test_sub', which has a field 'main_id'. This field is configured as an 1:m-relation to 'tx_test_year' -> this works perfect. But now you want also a field 'user', which is configured as an 1:m-relation to 'fe_users', but it should only show the users, which are associated to the main-record -> this does not work actually, because:

the config have to look like this:
'user' => array(
'type' => 'select',
'label' => 'User',
'config' => array(
'foreign_table' => 'fe_users',
'foreign_table_where' => ' AND tx_test_main.uid=###REC_FIELD_main### AND tx_test_main.uid = tx_test_year_user.uid_local AND tx_test_year_user.uid_foreign = fe_users.uid',
'size' => 1,
),
)

Attached are patches for TYPO3 3.8.1, 4.0.4 and 4.1RC1.

The only thing to change is in the function t3lib_befunc::exec_foreign_where_query()
(issue imported from #M5001)


Files

4-1RC1.diff (1.87 KB) 4-1RC1.diff Administrator Admin, 2007-02-16 10:35
4-0-4.diff (1.87 KB) 4-0-4.diff Administrator Admin, 2007-02-16 10:35
3-8-1.diff (1.87 KB) 3-8-1.diff Administrator Admin, 2007-02-16 10:35
bug_5001.diff (1.9 KB) bug_5001.diff Administrator Admin, 2007-03-06 07:31
Actions

Also available in: Atom PDF