Skip to content
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

unsupported data error with nested joins/preloads #6956

Open
N-Schaef opened this issue Apr 11, 2024 · 0 comments
Open

unsupported data error with nested joins/preloads #6956

N-Schaef opened this issue Apr 11, 2024 · 0 comments
Assignees
Labels
type:with reproduction steps with reproduction steps

Comments

@N-Schaef
Copy link

GORM Playground Link

go-gorm/playground#715

Description

In our project we have deeply nested data that needs to be joined and some additional values preloaded.

In a previous version of gorm (1.25.5) this was working.
Now we get a unsupported data error stemming from gorm/callbacks/preload.go#L140

The issue seems to be introduced in #6877.
The value of db.Statement.ReflectValue.Kind().String() is ptr.
My best guess is that preloads of sub-structs of optional nested structs/joins are the problem.

If I duplicate the whole case reflect.Struct: case (in gorm/callbacks/preload.go#L133) as an additional case reflect.Pointer: case, our code works again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:with reproduction steps with reproduction steps
Projects
None yet
Development

No branches or pull requests

2 participants