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

TypeError: enum_exists(): Argument #1 ($enum) must be of type string, null given, called in /.../ResolveForPropertyValueAction.php on line 37 #1114

Closed
stevebauman opened this issue Nov 10, 2022 · 0 comments · Fixed by #1115 or #1121
Assignees
Labels

Comments

@stevebauman
Copy link
Contributor

stevebauman commented Nov 10, 2022

Describe the bug
After updating to v4.7.0, I now receive the below exception in several areas of my application:

TypeError: enum_exists(): Argument #1 ($enum) must be of type string, null given, called in /.../ResolveForPropertyValueAction.php on line 37

To Reproduce
Create a new activity log with a null value for a custom property.

Expected behavior

This is a new exception. I'm assuming this is due to a custom property being set to null in my application:

$this->getActivity()->properties = collect($properties)->map(fn ($value) => ResolveForPropertyValueAction::execute($value));

Versions (please complete the following information)

  • PHP: 8.0
  • Database: MySQL 8.0
  • Laravel: 9.39
  • Package: 4.7.0

Stack Trace

TypeError: enum_exists(): Argument #1 ($enum) must be of type string, null given, called in .../vendor/spatie/laravel-activitylog/src/Actions/ResolveForPropertyValueAction.php on line 37
.../vendor/symfony/polyfill-php81/bootstrap.php:27
.../vendor/spatie/laravel-activitylog/src/Actions/ResolveForPropertyValueAction.php:37
.../vendor/spatie/laravel-activitylog/src/Actions/ResolveForPropertyValueAction.php:22
.../vendor/spatie/laravel-activitylog/src/ActivityLogger.php:106
.../vendor/laravel/framework/src/Illuminate/Collections/Arr.php:560
.../vendor/laravel/framework/src/Illuminate/Collections/Collection.php:719
.../vendor/spatie/laravel-activitylog/src/ActivityLogger.php:106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant