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

Having a column in the users table of notifications prevents the control panel loading #9932

Closed
samrobbins85 opened this issue Apr 19, 2024 · 0 comments
Labels

Comments

@samrobbins85
Copy link

Bug description

When you have a column in your users table called notifications, logging into the control panel produces the error Call to undefined method Statamic\Auth\Eloquent\User::morphMany()

How to reproduce

Create a statamic site, in your users table add a column called notifications, log into the control panel, once logged in you will see the error

Logs

#0 /home/vagrant/code/voice-holding/vendor/laravel/framework/src/Illuminate/Notifications/HasDatabaseNotifications.php(15): Statamic\\Auth\\User->__call()
#1 /home/vagrant/code/voice-holding/vendor/statamic/cms/src/Data/AbstractAugmented.php(60): Statamic\\Auth\\User->notifications()
#2 /home/vagrant/code/voice-holding/vendor/statamic/cms/src/Auth/AugmentedUser.php(60): Statamic\\Data\\AbstractAugmented->get()
#3 /home/vagrant/code/voice-holding/vendor/statamic/cms/src/Data/AbstractAugmented.php(39): Statamic\\Auth\\AugmentedUser->get()
#4 /home/vagrant/code/voice-holding/vendor/statamic/cms/src/Data/HasAugmentedInstance.php(21): Statamic\\Data\\AbstractAugmented->select()
#5 /home/vagrant/code/voice-holding/vendor/statamic/cms/src/Http/View/Composers/JavascriptComposer.php(99): Statamic\\Auth\\User->toAugmentedCollection()
#6 /home/vagrant/code/voice-holding/vendor/statamic/cms/src/Http/View/Composers/JavascriptComposer.php(62): Statamic\\Http\\View\\Composers\\JavascriptComposer->user()
#7 /home/vagrant/code/voice-holding/vendor/statamic/cms/src/Http/View/Composers/JavascriptComposer.php(26): Statamic\\Http\\View\\Composers\\JavascriptComposer->protectedVariables()
#8 /home/vagrant/code/voice-holding/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesEvents.php(124): Statamic\\Http\\View\\Composers\\JavascriptComposer->compose()

Environment

Environment
Application Name: Voice
Laravel Version: 10.8.0
PHP Version: 8.2.8
Composer Version: 2.7.1
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Localization
Installed: en, it, zh_CN, zh_TW
LaravelLang\Attributes\Plugin: v2.3.3
LaravelLang\HttpStatuses\Plugin: v3.3.1
LaravelLang\Lang\Plugin: 12.21.5
Protected Locales: en, it
Publisher Version: v14.6.4

Statamic
Addons: 0
Antlers: runtime
Sites: 7 (Voice, au, it, and 4 more)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.52.0 PRO

Installation

Existing Laravel app

Antlers Parser

None

Additional details

Statamic seems to be trying to call all the columns of the user table on the statamic user, which partly works on notifications because of the notifiable trait, but the $this->morphMany call within HasDatabaseNotifications in laravel isn't valid on the stamic user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants