Problem with "belongsToMany" not working
Hi, maybe someone knows the solution. When adding new entities using the admin panel, there is an error - the panel stops loading the table or form view, and the console returns errors as in the screenshot. I discovered that the cause is the relation “belongsToMany”, when I replace it with “belongsTo” everything works.
Here is a code snippet. I am trying to add a new unit, but the events do not work either. Interestingly, the groups themselves work fine, I can add several members.
And it's not a problem with policies either, I've already tried removing and changing them.
4 Replies
Btw - it adds a new unit if I don't select any groups, but in other cases it doesn't. However, it doesn't change the fact that I still can't display any record
Okay, I already know what this is about. The name of the relationship cannot be the plural of the entity name. I had to change for example from
{ name: units, entity: Unit }
to { name: organizer, entity: Unit }
.Hello @fedehusk did it work changing that name ? If not can you try renaming the "group" entity into something different ? The "group" word might mess things up
Yup, changing the relation name worked
Great, I created an issue for that: https://github.com/mnfst/manifest/issues/257
GitHub
Failing if entity name is "Group" · Issue #257 · mnfst/manifest
If the name of the entity is "Group" there is some weird behaviours: https://discord.com/channels/1089907785178812499/1323062280581152828/1323062280581152828 We should check that entity n...