Class name must be a valid object or a string error on activity log page #168

Closed
opened 2026-02-05 17:13:23 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Boy132 on GitHub (Oct 4, 2024).

When enabling Hide admin activies? the following error is thrown when viewing activity logs:
image

https://github.com/pelican-dev/panel/blob/main/app/Http/Controllers/Api/Client/Servers/ActivityLogController.php#L36

production.ERROR: Class name must be a valid object or a string {"userId":1,"exception":"[object] (Error(code: 0): Class name must be a valid object or a string at /var/www/pelican/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php:793)
[stacktrace]
#0 /var/www/pelican/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php(588): Illuminate\\Database\\Eloquent\\Model->newRelatedInstance()
#1 /var/www/pelican/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php(658): Illuminate\\Database\\Eloquent\\Model->morphToMany()
#2 /var/www/pelican/vendor/spatie/laravel-permission/src/Models/Role.php(82): Illuminate\\Database\\Eloquent\\Model->morphedByMany()
#3 /var/www/pelican/app/Http/Controllers/Api/Client/Servers/ActivityLogController.php(36): Spatie\\Permission\\Models\\Role->users()

When running the same method in tinker console no error is thrown:
image

Originally created by @Boy132 on GitHub (Oct 4, 2024). When enabling `Hide admin activies?` the following error is thrown when viewing activity logs: ![image](https://github.com/user-attachments/assets/8faa2a3e-57b4-4966-9f0a-a2b38ba3f170) https://github.com/pelican-dev/panel/blob/main/app/Http/Controllers/Api/Client/Servers/ActivityLogController.php#L36 ``` production.ERROR: Class name must be a valid object or a string {"userId":1,"exception":"[object] (Error(code: 0): Class name must be a valid object or a string at /var/www/pelican/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php:793) [stacktrace] #0 /var/www/pelican/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php(588): Illuminate\\Database\\Eloquent\\Model->newRelatedInstance() #1 /var/www/pelican/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php(658): Illuminate\\Database\\Eloquent\\Model->morphToMany() #2 /var/www/pelican/vendor/spatie/laravel-permission/src/Models/Role.php(82): Illuminate\\Database\\Eloquent\\Model->morphedByMany() #3 /var/www/pelican/app/Http/Controllers/Api/Client/Servers/ActivityLogController.php(36): Spatie\\Permission\\Models\\Role->users() ``` When running the same method in tinker console no error is thrown: ![image](https://github.com/user-attachments/assets/ef79e003-255f-4767-ac29-c402517c4405)
OVERLORD added the 🟡 medium label 2026-02-05 17:13:23 +03:00
Author
Owner

@lancepioch commented on GitHub (Jan 7, 2025):

We've replaced the front end.

@lancepioch commented on GitHub (Jan 7, 2025): We've replaced the front end.
Author
Owner

@Boy132 commented on GitHub (Jan 9, 2025):

Can't reproduce this anymore, neither on the new client ui nor via the api.
Might be related to the (missing) properties for activity logs, but I will create a separate for that. (#897)

@Boy132 commented on GitHub (Jan 9, 2025): Can't reproduce this anymore, neither on the new client ui nor via the api. Might be related to the (missing) properties for activity logs, but I will create a separate for that. (#897)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/panel-pelican-dev#168