Problem/Motivation

Follow-up from #3325964: Provide option to not remove all usage records when recreating entity usage statistics

@Berdir suggested in #3325964-3: Provide option to not remove all usage records when recreating entity usage statistics:

A second thing that would be very useful is being able to limit for which entity types you want to rebuild. Sometimes you enable a new source type on a site that has tends or hundreds of thousands of entities, but you're not interested in rebuilding that.

Which I believe makes sense, so let's work on implementing that here.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

marcoscano created an issue. See original summary.

marcoscano credited Berdir.

marcoscano’s picture

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

acbramley’s picture

Title: Allow to skip certain entity types when regenerating all statistics » Allow generating usage for certain entity types
Status: Active » Needs review

Re-scoping this to an allow list rather than a skip list.

I really need this feature for a client project I'm adding a new entity type to, so I worked with Claude to generate the MR.

I reviewed all code thoroughly and made a lot of manual adjustments as well.

I didn't find any existing test coverage for the batch manager specifically so the new test class covers that.

alexpott’s picture

@acbramley we're need to land this on 5.x too. Thanks for working on this.

alexpott’s picture

Version: 8.x-2.x-dev » 5.x-dev

The MR looks like useful functionality to have and shouldn't be too hard to port to 5.x too - just some differences in Drush command API.

The test coverage looks good too. Will merge once a 5.x MR exists and happy use the 8.x-2.x MR for backport.

acbramley’s picture

5.x branch is up :)

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

Nice one. Merging.

  • alexpott committed ee9cba98 on 5.x
    feat: #3348160 Allow generating usage for certain entity types
    
    By:...
alexpott’s picture

Status: Reviewed & tested by the community » 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.

  • alexpott committed b39031a4 on 8.x-2.x
    feat: #3348160 Allow generating usage for certain entity types
    
    By:...

Status: Fixed » Closed (fixed)

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