[TYPO3-dev] Possible bug: Relations with MM_opposite_field don't update the relation count of opposite field
Franz Koch
typo3.RemoveForMessage at elements-net.de
Thu Feb 11 15:07:04 CET 2010
Hi List,
I'm not sure if it's a bug, a misconfiguration or if I understood this
feature wrong. For select fields it's possible to define a
MM_opposite_field, which allows a relation to be edited from two sides.
This is working fine.
But the problem with this is, that editing the relation from the foreign
side doesn't update the relation count in the MM_opposite_field. Example:
Company (existing record)
- staff (MM-relation, field value by default: 0)
Person (new record)
- company (MM_opposite_field = company->staff)
If I save a record "Person" with assigned "company", the MM table is
updated just fine, but the field "staff" from the Company still has the
value 0 - but actually it should be 1, right?
So far I didn't care about that field value, but in a current project I
first check if the value of the field "staff" is greater then 0 and only
then fetch relations. I do this in order to save some unneeded queries
and processing time. But with this "bug" the information in the DB is
invalid and my application is delivering wrong results.
Do you guys think this is a bug? It wouldn't be a technical problem to
count the number of relations in the MM_table from the foreign side and
update the opposite field though.
--
kind regards,
Franz Koch
More information about the TYPO3-dev
mailing list