Skip to content

[12.x] Ensure automatic eager loading works in creating events #56193

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

Closed
wants to merge 5 commits into from

Conversation

jackbayliss
Copy link
Contributor

@jackbayliss jackbayliss commented Jul 1, 2025

When automatic eager loading is enabled, it seems to break for creating events in observers and model events.

It sets the relation to null, even if there is a relation - meaning tests etc that did pass, no longer pass.

I've added a test to prove creating events now work, if you remove the HasEvents changes I've added it then fails.
And, in the test if you set automaticallyEagerLoadRelationships to false, it'll work as it does without eager loading.

Open to suggestions, but thought I'd give it a crack.

Copy link

github-actions bot commented Jul 1, 2025

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

adjustments
@jackbayliss jackbayliss changed the title [12.x] Ensure automatic eager loading works in events [12.x] Ensure automatic eager loading works in creating events Jul 3, 2025
@jackbayliss
Copy link
Contributor Author

Closing as feels like an edge case, though fun to have a prod.

@jackbayliss jackbayliss closed this Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant