Problem/Motivation

The revisions are not aware of languages version, which is critical !!

The issue is already created for D7
https://www.drupal.org/project/node_revision_delete/issues/2817669

Steps to reproduce

- Create let's say 6 revisions of a node
- translate that content and create 6revisions of that translated content
- Set the module to keep only 5 revision
- run cron or prompt revision delete

- 5 revisions in total will remain, instead of 5 revisions of each language version.

Proposed resolution

The "Minimum number of revisions to keep" parameter must apply for each language of the site

Comments

matoeil created an issue. See original summary.

matoeil’s picture

in function getCandidatesRevisions, if the sub_query could be modified to select only for revisions of one language, looping through it with

// Getting the list of enabled languages
    $langcodes = \Drupal::languageManager()->getLanguages();
    $langcodesList = array_keys($langcodes);
    $language_number =count($langcodesList);

       for ($i=1; $i<=$language_number;$i++) {
        foreach ($candidate_nodes as $candidate_node) {
          $sub_query = $this->connection->select('node_field_data', 'n');

...

is maybe the way to go to ensure that the minimum_revisions_to_keep is applied for each active language instead of all revisions as a whole

dbielke1986’s picture

+1

heddn’s picture

heddn’s picture

Status: Active » Closed (duplicate)