It would be good to add some logging to the entity delete action, just like \Drupal\Core\Entity\EntityDeleteFormTrait does.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Dave Reid created an issue. See original summary.

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB
dave reid’s picture

Status: Needs review » Needs work

Message needs tweaking.

graber’s picture

Hi, thanks for your work on the subject @Dave Reid.

2 things:

  1. Execute method should return results that can be grouped, otherwise you may get a lot of messages when action is executed, the returned value should be as it was or maybe grouped into entity types.
  2. Use dependency injection for logger service (example constructor and create methods can be found in views_bulk_edit module action), the logger() method will not be needed.
balintbrews’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
Status: Needs work » Needs review
StatusFileSize
new3.02 KB

I rerolled the patch for 8.x-3.x-dev and made the requested changes.

graber’s picture

Status: Needs review » Needs work

Nice, but this should be configurable in the View admin (see ViewsBulkOperationsPreconfigurationInterface), imagine someone deleting 100 000 entities in a bulk operation and getting this many log entries..

paulsilva made their first commit to this issue’s fork.

peachez’s picture

Adding Reroll patch for 4.3.x
I dont seem to be able to push to push to issue fork. Im sure im doing it wrong :P

malcomio’s picture

Version: 8.x-3.x-dev » 4.3.x-dev

graber’s picture

Left a review, also please make sure all checks are green.

graber’s picture

Ok, I left the review on https://git.drupalcode.org/project/views_bulk_operations/-/merge_request... but it also applies to the latest branch.

malcomio’s picture

Status: Needs work » Needs review
graber’s picture

Status: Needs review » Needs work

Great but please see my notes on the other MR that also apply.

malcomio’s picture

Status: Needs work » Needs review
graber’s picture

Thank you, Looks good!

I have one more concern: what if someone deletes a lot of entities - do we still want to log all that? I think we may leave it as is for the time being though and if someone's log will be flooded and they don't like that they can always create a follow-up to make it configurable.

I'll let it lay for a week or so in case someone else had any feedback.

malcomio’s picture

Thanks - that sounds like a good way forward.

If we do make it configurable, I'd suggest that the default is that logging is enabled.

I was surprised when I realised that nodes deleted this way weren't logged - I'd say it's better to be consistent with core, which does log individual node deletion.

graber’s picture

Version: 4.3.x-dev » 4.4.x-dev

  • malcomio authored 47f8819d on 4.4.x
    [#2985399] feat: Add logging for delete action
    
graber’s picture

Status: Needs review » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.