Add support for "Maximum number allowed" revisions per content node translation

Created on 7 March 2020, over 4 years ago
Updated 7 March 2024, 7 months ago

Problem/Motivation

When using Drupal core's Content Translation content, Node Revision Delete does not retain X "Maximum number allowed" of revisions per node translation. Instead, Node Revision Delete will only retain X "Maximum number allowed" of revisions per node, which risks deleting all revisions of a single translation, including an old pending draft revision if using Drupal core's Content Moderation and Workflows (see related #3094354: Delete draft revisions safely ).

Steps to Reproduce

  • With Drupal core's Content Translation and Languages enabled and configured, create a node item with a translations A and B.
  • Create multiple (4+) revisions of a single translation A
  • Create multiple (4+) revisions of the other translation B so that these are more recent than the previously created revisions
  • Using Node Revision Delete default configuration and changed both "Maximum number allowed" to 4, Delete revisions now
  • Observe that all of the old revisions matching Node Revision Delete configuration are deleted, expected
  • Observe all translation A revisions are deleted

I think the expected behavior for a multilingual site would be that configuration would apply consistently to node translations, so that 4 translation A revisions are kept and 4 translation B revisions are also kept...particularly if using Content Moderation and Workflows and there is a pending draft translation revision (see related #3094354: Delete draft revisions safely ).

Proposed resolution

TBD

Remaining tasks

  • Get consensus about how to solve it
  • Patch
  • TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇺🇸United States jasonawant New Orleans, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇮Finland heikkiy Oulu

    The merge request diff applies against latest rc6 but there is a message in the merge request that it needs a rebase against the main branch.

  • 🇳🇱Netherlands seanB Netherlands

    We just added a 2.x version of the module. This is a complete rewrite based on plugins to determine which revisions can be deleted. It also uses a queue worker to actually delete revisions, and takes multiple translations of content into account. Could you please test if this solves the issues you currently experience?

  • For me, the new version 2.x does not work. Previously, too many revisions were deleted. But now too few revisions are deleted. At least that's how it looks.
    In the sandbox, the module works great at first sight. But in our system with two languages and 40k revisions, it doesn't seem to work. Too bad!

  • 🇱🇺Luxembourg B-Prod

    I confirm what @vincent.hoehn say: the 2.x version does not work at all, if I specify to keep only 1 revision, nothing happens.

    For example, I have a node with 2860 revisions, none is deleted.

  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • 🇨🇴Colombia alejomc

    For those whose need the patch for -rc6.

  • 🇳🇱Netherlands seanB Netherlands

    @vincent.hoehn @B-Prod could you maybe try and debug what is happening in the 2.x version to see why the revisions are not being deleted? Are you getting errors in the logs? Are items being added to the queue? Is the queue being processed? Is this process running out of memory? Any additional info to help resolve the issues would be appreciated!

  • 🇫🇮Finland tvalimaa

    #42 looks like working with 1.0 rc-7.

    I have now check and calculate revisions count per node and node translations after clicking delete revisions on node.

  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 10 months ago
    Waiting for branch to pass
  • 🇮🇳India smitghelani Surat, Gujarat

    #42 has one code change is missing from #37,
    File CandidateNodesForm.php has below mentioned change inside the #37 patch, but which is missing inside the #42 patch i have added that change and created new patch and other changes are same as #42 and tested with latest version of module 8.x-1.-rc7.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update 10 months ago
    106 pass, 1 fail
  • Status changed to Closed: outdated 7 months ago
  • 🇨🇦Canada adriancid Montreal, Canada

    Closing because the current development is being made in branch 2.x

Production build 0.71.5 2024