Skip to content

stop logging empty changes after pipe manipulation #1430

@felabrecque

Description

@felabrecque

Describe the bug
When using the pipe introduced in v4, we can remove changes.

The check to see if we should log even when empty changes is done prior to the pipe call.

To Reproduce
Add a pipe that removes all changes.
set LogOptions to only NOT log when empty changes.

Expected behavior
No log entries should be created.

Versions (please complete the following information)
latest laravel-activitylog

Additional context
I am using spatie/laravel-data model cast.

The dirty comparison in activitylog is crude (using spaceship <=> operator to compare) so my model field is always dirty.

I am using a pipe to do a manual dirty checkup, but if that field was the only dirty field, I still get an entry in the activity table since the log options have been handled previously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions