Update for Drupal 10/11.

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

liam morland created an issue. See original summary.

liam morland’s picture

Status: Active » Needs review

syam kumar made their first commit to this issue’s fork.

liam morland’s picture

What is the reason for using dependency injection and non-static methods for this? This way it will have to persist an instance of DeleteUsersBatch in the batch process. I don't think that is an improvement.

syam kumar’s picture

I agree with your point, and I would like to add a few observations:

1. Single Job Execution Issue:
In the current implementation, all users deletion activities are being executed within a single batch job operation. This design does not differ significantly from a traditional, monolithic deletion process. The primary advantage of batch jobs is to efficiently manage resources by breaking operations into smaller, manageable chunks.

2. Dynamic Service Loading:
The required Drupal services are currently being loaded dynamically, which is typically more suited for procedural code (e.g., within `.module` files). However, Drupal best practices recommend using Dependency Injection (DI), especially in object-oriented components such as services, controllers, and plugins. Additionally using DI, makes it significantly easier to write unit tests.

  • liam morland committed 7c0f1490 on 8.x-1.x
    Issue #3524951: Allow use by users with permission `administer users`
    

  • liam morland committed 7a95094b on 8.x-1.x
    Issue #3524951: Replace user_load_by_mail() with ::loadByProperties()...

  • liam morland committed df2c4870 on 8.x-1.x
    Issue #3524951: Call trim() on email addresses, including removing...

  • liam morland committed 24467242 on 8.x-1.x
    Issue #3524951: Update user interface strings
    
    ::validateForm() is...

  • liam morland committed d3f1506b on 8.x-1.x
    Issue #3524951: Make DeleteUsersBatch::deleteUsersCallback() be static
    

  • liam morland committed a271ec62 on 8.x-1.x
    Issue #3524951: Remove LICENSE.txt
    
    The license will be added by the...

liam morland’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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