Feature #17156

Define type of child record

Added by David Bruehlmeier over 12 years ago. Updated over 1 year ago.

Status:
Accepted
Priority:
Should have
Assignee:
Category:
FormEngine aka TCEforms
Start date:
2007-03-27
Due date:
% Done:

0%

PHP Version:
4.3
Tags:
Complexity:
Sprint Focus:

Description

I would like to propose a new IRRE feature which allows to define the type of the foreign record created by IRRE.

Let me explain by taking two real-world examples from the Party Information Framework:

1. A party can have 0..n names. Each name has a type (either "person name" or "organisation name"). The type defines which fields are available for input, using the regular type-definition of TCA.

2. A party can have 0..n images. The same is true for addresses. Each image also has a type (either "party image" or "address image").

The feature request: As soon as the slave record is created by IRRE, the proper type is already selected (and not changeable). Only the fields for the selected type (according to TCA) are displayed.

I propose a new TCA attribute, e.g. 'foreign_type', which might look as follows:

Case 1:
$TCA['tx_party_parties']['columns']['names']['config'] = array(
...
'foreign_type' => array(
'0' => '0', // Party type = 0 (Person) => Name type = 0 (Person name)
'1' => '1', // Party type = 1 (Org.) => Name type = 1 (Org.name)
),
...

Case 2:
$TCA['tx_party_parties']['columns']['images']['config'] = array(
...
'foreign_type' => 0, // Always "Party image"
...

$TCA['tx_party_addresses']['columns']['images']['config'] = array(
...
'foreign_type' => 1, // Always "Address image"
...

So the general rule is:
1. If the 'foreign_type' is an array, then the array is a mapping from "Type of master table" to "Type of slave table".
2. Else it is the type of the slave table, regardless of the type of the master.

See Thread in the IRRE Newslist:
http://lists.typo3.org/pipermail/typo3-project-irre/2007-March/000101.html
(issue imported from #M5300)


Related issues

Related to TYPO3 Core - Bug #17442: Default values defined in TCA not used in IRRE children Closed 2007-07-06
Duplicated by TYPO3 Core - Feature #17256: Define type of foreign record Closed 2007-04-27

History

#1 Updated by Jeff Segars almost 12 years ago

I agree that this would be a great addition to IRRE.

My scenario is like case #2. I'm currently using a foreign_table_field to save the types correctly, but I would prefer that my type field not be editable like David describes.

#2 Updated by Thomas Deinhamer almost 7 years ago

That's a nice feature for which I'm in need actually too. :)

#3 Updated by Stefan Galinski over 6 years ago

  • Category set to 978
  • Target version deleted (0)

#4 Updated by Mathias Schreiber over 4 years ago

  • Target version set to 8 LTS

#5 Updated by Riccardo De Contardi over 2 years ago

  • Target version changed from 8 LTS to 9.0

#6 Updated by Susanne Moog over 1 year ago

  • Target version changed from 9.0 to Candidate for Major Version

Also available in: Atom PDF