[TYPO3-mvc] IRRE and intermediate tables

Andreas Kießling andreas.kiessling at web.de
Thu Apr 1 12:02:10 CEST 2010


Hi Jochen,

i guess i have found a bug concerning the IRRE handling:

I have restructured my extension from "Attributes on irre-relations 
possible" to work with a "real" table. In the backend, i have the column 
configured with foreign_selector and foreign_unique pointing to the same 
field and size = 10. This way, a 1:n relation can be set up, with a 
prefilled selector box where you can simply click on an entry to create 
the relation, instead of clicking the "Create new"-button and choosing a 
value from the a select field.

The DataMapFactory->setRelations expects all foreign_selector occurences 
to be a n:m relation, but in fact, i'm creating just a 1:n.

The example for foreign_unique from doc_core_api could be set up just 
like that:

main table products
--> relation to intermediate table which has a (select) relation to 
group and relation or textfield for price. (Like you said, not really an 
intermediate table, but a foreign_key relation.) The label field for 
intermediate table should be set to the group field to display the name 
in the select box.

--> set foreign_selector to group field
--> set foreiqn_unique to group field
--> price is an attribute for the relation


This check should work, so that extbase returns the right type of relation:
if (isset($columnConfiguration['MM']) || 
(isset($columnConfiguration['foreign_selector']) && 
(!isset($columnConfiguration['foreign_unique']) || 
($columnConfiguration['foreign_selector'] != 
$columnConfiguration['foreign_unique']) ))) {

I don't know if it is the proper way to check for this "special" kind of 
relation, but i have used such a TCA quite a few times for "attributes 
on relations" with pibase extensions.


Regards and thanks for hard work on extbase,
Andreas


More information about the TYPO3-project-typo3v4mvc mailing list