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

Steffen Kamper ks at dislabs.de
Thu Feb 11 18:04:35 CET 2010


Hi,

Franz Koch schrieb:
> 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.
> 

i also fighted with such configurations, and i have the feeling that it 
is indeed buggy, but will work when adding the right configuration. Main 
problem is the bad documentation of these special cases.
Try using neg_* configs as well, and read several time the 
t3lib_loadDBGroup how these configs are used, that helped me with my 
problems.

And it's worth if you got it to post the working solution ;)

vg Steffen




More information about the TYPO3-dev mailing list