In our own extension we have a table that should have an n:m relation to itself.
I'll make a figurative example (our real case is similar to it):
Let's call the table 'employee'.
Now an employee can be attached to other employees, e.g. I edit employee A and attach it to employee B. When I open employee B I would like to see that he has an attachement to employee A.
I tried the following configuration in the tca.php:
'linked_with' => array (
'exclude' => 0,
'label' => 'LLL:EXT:my_ext/locallang_db.xml:my_table.linked_with',
'config' => array(
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'my_table',
'size' => 6,
'MM' => 'my_table_linked_mm',
'MM_opposite_field' => 'my_table'
)
)
However when I do this, then it saves only the relation in one direction, i.e. I see in employee A, that it has a relation to employee B. But when I open employee B I don't see any relation to employee A.
In the database one entry was saved with:
- uid_local: ###UID of employee A###
- uid_foreign: ###UID of employee B###
- sorting: 0
- sorting_foreign: 1
What am I doing wrong? I couldn't find a similar case on Google/Internet - all I found was with two different tables.