sjelfull / craft-audit

Audit log for Craft 3
https://superbig.co
Other
20 stars 11 forks source link

Deleted element behaviour on multisite setups #62

Closed milesjbland closed 2 years ago

milesjbland commented 4 years ago

Question

I have a multisite setup, with each site representing a language. Our default site is called “English”.

I've noticed that if I delete a block on a matrix field on any other site, Audit logs the correct site on the saved element, but logs the default site on the deleted element.

For example, if I delete a matrix block on the “German” site:

Screenshot 2020-08-21 at 16 15 10

I wondered if this is expected behaviour? Should it say “German” here, or is there no relationship between matrix blocks and sites, and the plugin is falling back to the default site's name?

Additional context

The propagation method for the matrix field was originally set to Save blocks to all sites the owner element is saved in, but we updated it at some point to Only save blocks to the site they were created in before installing the Audit plugin.

My original thought was that the blocks were still related to the default site because of this, but if I add and remove a block in another language, I still see the same results as the screenshot above.

sjelfull commented 4 years ago

Thanks for reporting. This is interesting - will need some time to look into this.

sjelfull commented 2 years ago
image

This is fixed in 3.0.1, out just now.

It was unintentional that it logged deleted Matrix blocks to begin with, so I have disabled that behaviour by default and added a config option named logChildElementEvents.