Laravel-activitylog: Delete event not Logged on 1.6 version

Created on 13 Aug 2016  路  23Comments  路  Source: spatie/laravel-activitylog

I ran the command "composer update" and "laravel-activitylog" updated to version 1.6.0
The event recording the record deletion log was not executed, the record was deleted from the Model table, but was not included in the "activity_log" table.

All 23 comments

The test seems to confirm that record deletion logging works. Could you post a failing test?

Or maybe if you post your model and used code, I can see what's wrong.

+1 for v. ^1.7 with Laravel 5.3 RC1

I'll tag a new version when Laravel 5.3 gets released (probably tomorrow)

I have the same problem. No delete logging is occurring. I am on Laravel 5.2.

The test seems to confirm that this should work: https://github.com/spatie/laravel-activitylog/blob/master/tests/DetectsChangesTest.php#L83-L96

Could you PR a failing test for me to fix?

Still not logging deletes after update to Laravel 5.3.10 and Avtivity log 1.9.1

Sorry, don't quite understand what you want me to do when you say "PR a failing test for me to fix". I am using the trait in my models and creates and updates all log fine - but nothing for deletes.

Well, my automated tests seem to indicated that a deletion is logged. It would help me to track down and solve the bug if you can create a test that illustrates that a deletion is not logged.

Create a model, any model. Add use Spatie\Activitylog\Traits\LogsActivity. Within the class, use LogsActivity. Create a record. Then delete the record. The create appears in the log. The delete does not.

If you take a look at the deletion test you'll see that it does exactly the same thing that you are describing.

In my projects this seems to work as well.

Could you please check what you are doing differently from the test? If the test contains an error let me know.

I am sorry but your test bears no resemblance to what I am trying to do or what your documentation suggests is possible. I am simply attaching your trait to the model and then using LogsActivity. I have proved happily that a create and an update are both logged perfectly by this means. However a delete does not write anything to the log.

This is clearly a bug in the model attachment behaviour.

The test sets up a model that uses the LogsActivity trait. Then an new instance of the model is created and deleted.

Please help me to understand what you are doing differently?

If you have a fix in our code for the problem you are experiencing I'd gladly take a look at a PR.

@freekmurze I just modified the delete event test and breaked it, It's wired can you take a look at it?

@xcaptain thanks for submitting a test. You were using a model which does not use the LogsActivity trait, so it a failure was expected there.

@freekmurze please review my new pull request https://github.com/spatie/laravel-activitylog/pull/77

Thanks again @xcaptain for demonstrating that there is indeed an issue.

I've pushed a fix to the master branch. Those with problems, could you try the current master version and let me know if the deletion is logged now?

Did not work for me, still not logging deletes.

@sineld could you tell me what you are doing differently from this test?

@freekmurze delete log on dev-master works for me, I think this bug fixed 馃憤

@freekmurze logging on dev-master branch works for me too. Finally fixed, thank you.

Fix has been tagged as v1.9.2.

At last I can confirm that this is fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kcristella picture kcristella  路  5Comments

hackel picture hackel  路  5Comments

chriship picture chriship  路  4Comments

damosse31 picture damosse31  路  5Comments

TheFrankman picture TheFrankman  路  5Comments