[TYPO3-dev] Possible bug: Relations with MM_opposite_field don't update the relation count of opposite field

Martin Keck keck at bloompark.de
Fri Aug 13 18:11:58 CEST 2010


Hi Franz,

would you be so kind and share your patch again. The link has expired. 
Would be great as I'm struggling with this thing for hours already...

Thank you very much in advance!

Greetings,
Martin

ps: One thing I was wondering about is if it's a bug at all. If I take a 
look at my mm table the fields uid_local and uid_foreign are filled 
either with the uid of table1 or table2 depending from which side I've 
added an element.

E. g.:
table1 was updated --> uid_local = uid from table1, uid_foreign = uid 
from table2
table2 was updated --> uid_local = uid from table2, uid_foreign = uid 
from table1

I'm not quite sure about it, but shouldn't always uid_local be filled 
with uid from table1 and uid_foreign with uid from table2? And maybe 
this leads to a wrong count of the according fields in both tables? But 
if so how can I change this behaviour as I need the "foreign_table" 
property in both TCA definitions to get the select list in the backend. 
Clueless...



Franz Koch schrieb:
> Hi,
> 
>> could you please post your hook solution here?
>> It would save my day! Thanks!
> 
> I recently found some missing features in my hook solution. I needed the 
> functionality for group fields, but my hook is for now only working with 
> select fields (foreign_table). I also noticed that if you edit the 
> 'local' side, the foreign side doesn't get updated (of course), because 
> it's nowhere defined that there is a bidirectional relation here. So in 
> future there might be a additional option/setting needed for the local 
> side to define that it's bidirectional. But besides of that it's working 
> like a charm.
> 
> http://pastebin.com/hSpkTp6Z
> 
> Please note that it's only working in recent 4.4 trunk, because I make 
> use of a recently added feature where old and new MM relations get 
> stored in a cache inside TCEMain (mmHistoryRecords). So for 4.3 you 
> would need to apply the according TCEMain patch or find another way to 
> find out the old relations inside the hook (that's what I tried at first 
> until I found that mmHistoryRecords in latest trunk).
> 
> Hth.




More information about the TYPO3-dev mailing list