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

[4.x] Prevent calling notifications method on User model #9936

Closed

Conversation

duncanmcclean
Copy link
Member

This pull request fixes an issue when storing users in a database, where if you have a column called notifications, an error would be thrown during augmentation.

This was happening due to the Eloquent User model having a notifications method which returns a morphMany relationship, which our augmentation stuff doesn't know how to work with.

This PR fixes that by preventing the method on the User being called and falls back to checking the raw data on the user instead.

Fixes #9932.

@jasonvarga
Copy link
Member

Things have changed a little in v5 so there might be some conflicts. Also, you should just add a notifications method to AugmentedUser rather than modifying AbstractAugmented. You can reopen targeting 5.x.

@jasonvarga jasonvarga closed this May 8, 2024
@jasonvarga jasonvarga deleted the fix/prevent-calling-notifications-method-on-user branch May 8, 2024 18:33
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.

Having a column in the users table of notifications prevents the control panel loading
2 participants