This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
When creating an entry through my controller, I want to be able to add relationships through a relation manager.
I'm getting a constraint violation
that's being thrown by the relation manager, stating that my foreign key can't be null
. This is absolutely true of course, but there must be an (automated) way to postpone the create action of the relation manager.
I know why it's failing, but what I want to know how to get around it. I've read up about deferred bindings and that looks like the thing I need, but I can't figure out how to implement it in such a way that I don't have to write the create actions myself.
Is this possible or am I being lazy?
I just started having this issue too. Started getting integrity constraint violations when creating child relationships. In my case, the parent model is already created. When attempting to save a child, it throws an error. Not really sure why -haven't messed with the relationships in the models lately and the configuration loads the correct form fields for the child.
I believe this has something to do with it:
https://github.com/octobercms/october/commit/af657e9399e3ac74ed70a0b35089b24e07cf56e9
It seems to be fixed in developer branches https://github.com/octobercms/october/commit/c30b34e4d94560a7590104dbce20cabac7262285
1-5 of 5