Problem/Motivation

The module currently does not provide a command-line workflow for cleaning orphaned block content entities.

Site administrators and developers should be able to execute orphan cleanup operations directly through Drush for automation, scripting, and maintenance workflows.

A Drush cleanup command would also provide a safer operational workflow when combined with dry-run support.

Steps to reproduce

  1. Create orphaned custom block content entities
  2. Attempt to remove orphaned blocks using Drush
  3. Observe that no dedicated orphan cleanup command exists

Proposed resolution

  • Create a Drush command class for Block Content Explorer
  • Add a dedicated orphan cleanup command
  • Use the existing OrphanCleaner service for cleanup operations
  • Add support for configurable cleanup limits
  • Add dry-run support for safe preview execution
  • Display cleanup results through CLI output

Remaining tasks

  • Create Drush command class
  • Register Drush services
  • Inject orphan cleanup service
  • Implement orphan cleanup command
  • Add dry-run option support
  • Test command execution using Drush
  • Verify cleanup logging behavior

User interface changes

None.

This issue adds command-line functionality only.

API changes

Adds new Drush command integration for orphan cleanup operations.

Data model changes

None.

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

mohnish s. yadav created an issue. See original summary.

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

oshi02’s picture

Status: Active » Needs review
mohnish s. yadav’s picture

Status: Needs review » Fixed

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

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

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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