$last_nid gets stuck if no candidate revisions exist

Created on 15 May 2024, about 1 month ago
Updated 29 May 2024, 28 days ago

Problem/Motivation

In a test environment, I noticed that a node with revisions that should be pruned was not being processed. It appears the $last_nid gets stuck (not reset to 0) if all nodes with an entity_id greater than $last_nid do not have any candidate revisions.

Steps to reproduce

If for example, you have 3 nodes (nid 1, 2, 3), set the following:
\Drupal::state()->set('cm_revision_delete.last_nid', 2);

Make sure nid 3 doesn't have any candidate revisions. The latest_nid will not be reset back to 0 in order to start processing at the beginning of the list.

Proposed resolution

Check if cm_revision_delete_get_node_candidate() returns anything, else set latest_nid back to zero.

πŸ› Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada smulvih2 Canada 🍁

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024