I have defined a HasMany relationsship in my Nova resource. Nova fires two requests when trying to load the children in the parent detail view:
1. GET /nova-api/childResources?viaResource=parentResources&viaResourceId=4711&viaRelationship=childResources&relationshipType=hasMany
-> This correctly returns the related records.
2. GET /nova-api/childResources/relate-authorization?viaResource=parentResources&viaResourceId=4711&viaRelationship=childResources&relationshipType=hasMany
-> This fails with a HTTP 500 returning Class name must be a valid object or a string
.
Digging deeper into the underlying NovaRequest, I found out that all query params are gone inside the request. This is why viaResource
cannot be used to instantiate a class and to above error occurs.
I have no idea, what could cause this.
Turned out, the problem originated from an incomplete nginx configuration. I wasn’t passing the query string to PHP.