GORM Playground Link

https://github.com/go-gorm/playground/pull/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.