Select many to many problem
Hello!
I have the following error in a Select field with many to many relationship.
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sshKeys' in 'field list'
The form contains:
This is the relationship in the model
The select field is filled successfully but when I try to save it I get the following error.
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sshKeys' in 'field list'
If I do my Select as multiple then everything is working properly.
Any suggestion for the error?4 Replies
If I do my Select as multiple then everything is working properly.
Yes, it should be multiple
Are you sure about this? Is it a bug? Or is something missing from my code?
Yeah it's because it's a Many to Many relationship, when it's not multiple it's trying to set a column on the parent record called "sshKeys" rather than attaching using the intermediate table
What is it you're trying to achieve? Only allowing 1 option to be set? You could use a validation rule for that?
No it is fine for me with multiple. I was wondering if it was a mistake from my side. Thanks for your answers!