Project

General

Profile

Actions

Feature #82549

open

Enable support for "real" 1:n relations

Added by Nico de Haen about 7 years ago. Updated over 3 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Start date:
2017-09-25
Due date:
% Done:

0%

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

Description

Currently a true 1:n relation is only configurable as IRRE or with a MM table. It should be possible to configure that only with a foreign key field in the child table.

What you can do is this:

['parent_table']['columns']['children'] => [
     'config' => [ 
           'type' => 'select',
           'renderType' => 'selectMultipleSideBySide',
            'size' => 5,
            'maxitems' => 20,
            'foreign_table' => 'child_table',
            'foreign_field' => 'parent_id'
     ]
]

But that would result in a comma separated list of UIDs in the children field of the parent, while it should result in all selected children having the UID of the parent in their parent_id field.

TCA documentation does not mention, that it is not possible except with comma separated UIDs in the parents field, which requires an appropriate column type...

It has to be handled if children which are already assigned to other parents should just be reassigned when selected for another parent or if they should only be selectable if they are not yet assigned. A configuration flag like onlyShowUnassigned = true/false would be fine...

Maybe since we have Doctrine now, this is not too hard to implement...?

Actions

Also available in: Atom PDF