Open reddo opened 4 years ago
I went through the database and I couldn't find any difference between the 2 entities and their relation (collections, junction collections, and fields are all basically the same). I am stumped.
I even deleted and recreated the fields and junction collections. Any ideas as to what else I could try?
What are the fields in the current, junction, and related fields?
@rijkvanzanten, I'm not sure which collections' field you need, but here's what I got that's related
Main collections' m2m field:
junction collection:
Related collection:
Thanks! That's exactly what I was looking for. I'm wondering if it has something to do with the fact that the name of the o2m is the same as the name in the junction table 🤔 That shouldn't cause it to break of course, but that's one explanation why some m2ms fail, but others don't.
It's the same for the rest of the m2m fields too. I can try and use different names. It's really inconvenient that I can't edit m2m fields though.
@rijkvanzanten, using different names for the junction collection fields seems to work. Now I have to redo the other fields. I'm curious as to why it worked well with the other fields though.
Yeah me too! I'm starting to suspect that it might be the API mishandling it, as the payload in the OP looks correct to me 🤔
Directus API version 8.6.2 PHP version 7.3 MySQL version 10.2.27-MariaDB-cll-lve Apache version 2.2.34
I have a collection with a bunch of many-to-many fields. All of the many-to-many fields have exactly the same configuration. I edit the collection, add values to the m2m fields and some of them throw the following error:
Error: Attempting to write an array as the value for field "family_features" in "locations_family_features"
The payload looks right too:The
features
andfamily_features
throw the error. All of the junction collections were auto-generated and look exactly the same to me.