-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nova BelongsTo field->attribute returning relation name rather than foreign_key #82
Comments
I've done some more digging and, unless I've missed something obvious in my configuration, then the issue appears to be in A hacky soluion which gets things working is
Not sure how we can use any of the properties from the $field object to get the foreign_key from the BelongsTo relation when we don't have a model instance to work with at this point. |
@simonhamp Sorry to tag you into this directly, but would appreciate knowing if this package handles relationships (and if so what I'm doing wrong in my configuration). |
@phpMagpie |
@stevenwaskey I've not put this package into production, so did not get any further than the above I'm afraid. I hope you have better luck. Shame @simonhamp does not have the time to support it, but understandable as I'm sure he has a day job to tend to. |
The package doesn't support relationships yet. If someone wants to PR support for it, I'll be happy to review it |
@simonhamp thanks for the update and sharing the package in the first place. |
I'm trying to import records into a link model similar to
My Nova Resource has fields of
The import process looks great all the way up to the import then returns an error with class_id
{ "errorInfo": [ "HY000", 1364, "Field 'class_id' doesn't have a default value" ], "connectionName": "mysql" }
I think this is caused by the BelongsTo Class field being mapped to the
class
relation name rather than theclass_id
model field.On the Configure screen the fields are showing as
rather than
As such the import is failing as the model needs values for
class_id
andstudent_id
If this is the case, I'm not sure how to solve/work around this. Hopefully I'm missing something obvious.
UPDATE:
If I change my resource fields to ...
I can then get the import to work, which seems to prove my theory, but is not a useable workaround as I don't want those number fields in my resource.
The text was updated successfully, but these errors were encountered: