Problem/Motivation

The module adds a checkbox and table to the revision deletion form that allows you to delete prior revisions. The table is unbounded and attempts to load all revisions of the node to do this. If this is possible and you check the box to delete the prior revisions a batch is created with an operation per revision. Neither of these approaches is correct.

Steps to reproduce

Create a node with thousands of revisions and visit the revision delete form of one of the newest revisions.

Proposed resolution

  • Limit the table to the next 20 revisions and then provide a count.
  • Create the batch with revision ID to delete prior revisions to and rerun the same batch till there are no more revisions to delete.

Remaining tasks

User interface changes

  • The revision delete page no longer has a table with every prior revision in it. The table is limited to 20 revisions - it provides a count and adds a row saying how many more if there are more than 20 prior revisions.
  • The batch messages have been tweaked to account for skipping revisions due to default revision or active revision for a langcode.

API changes

  • NodeRevisionDeleteBatch / NodeRevisionDeleteBatchInterface tweaked to support only one batch operation instead of an operation per revision. Note NodeRevisionDeleteBatch should not be considered API.
  • NodeRevisionDelete::getPreviousRevisions() deprecated in favour of getPreviousRevisionIds()

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

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
alexpott’s picture

Status: Needs review » Reviewed & tested by the community

I've tested this on a site with a node with over 9000 revisions - you can now load the revision delete page and not get out-of-memory errors and you can process the batch to delete prior revisions. It takes some time - about 10 minutes - the content has a lot of paragraphs but it is working nicely.

alexpott’s picture

Issue summary: View changes

  • alexpott committed 85fe8ad2 on 2.1.x
    fix: #3584872 Prior revision deletion form can easily cause out-of-...
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.

Status: Fixed » Closed (fixed)

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