-
Notifications
You must be signed in to change notification settings - Fork 630
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
Nested eager load throws error when nested tier is missing #2708
Comments
I should note that the query is fine if any of the posts are missing an assigned user, so long as all of the users that are assigned have photos. |
With a little more experimentation, it seems like user photos might be a special field, not treated like a normal Asset field. So perhaps my assumption that I could eager load the image asset is incorrect. |
Yep users do support eager-loading their photos. That error should be fixed for the next release. Thanks for reporting! |
Description
I'm executing a nested eager load: querying for a list of entries, eager loading the user from a specific field, and also that user's profile photo.
If any of the users don't have a profile photo, I get the following error:
TypeError Argument 1 passed to craft\helpers\StringHelper::toLowerCase() must be of the type string, null given, called in [...]/vendor/craftcms/cms/src/helpers/Db.php on line 448
I'd expect to be able to just handle a missing photo in my template code after the query executes.
Steps to reproduce
Additional info
Stack Trace
The text was updated successfully, but these errors were encountered: