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

[Bug] Setting default_log_name to null breaks logging #1028

Closed
stevebauman opened this issue Mar 29, 2022 · 0 comments · Fixed by #1029
Closed

[Bug] Setting default_log_name to null breaks logging #1028

stevebauman opened this issue Mar 29, 2022 · 0 comments · Fixed by #1029
Labels

Comments

@stevebauman
Copy link
Contributor

stevebauman commented Mar 29, 2022

Describe the bug
The activity_log schema for log_name is nullable(), yet setting default_log_name inside of the configuration breaks logging entirely.

To Reproduce
Set activity_log_name to null, then try logging:

config(['activitylog.default_log_name' => null]);

activity()->log('foo');

Exception

Spatie\Activitylog\ActivityLogger::useLog(): Argument #1 ($logName) must be of type string, null given, called in ../laravel-activitylog/src/helpers.php on line 14

Expected behavior
Since the database table schema supports a nullable log_name, we should be able to create log entries with a null log name instead of an empty string, so that we may use Activity::whereNull('log_name').

@stevebauman stevebauman changed the title Setting default_log_name to null breaks logging [Bug] Setting default_log_name to null breaks logging Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant