I read thru the code a noticed that there are no cron tasks to add outdated revisions to the queue.
The queue adding relies on the node_update hook to check if the conditions are met, but if the nodes are not saved then they are not added to the queue.
This type of query with releted configs should be written for all content types and added to the queue.
/**
* Implements hook_cron().
*
* Add node revisions older than 1 months and have more than 4 revisions.
* to the Node Revision Delete queue.
*/
function node_revision_delete_cron() {
if (\Drupal::moduleHandler()->moduleExists('node_revision_delete')) {
$db = \Drupal::database();
$query = $db->select('node_revision', 'nr')
->fields('nr', ['nid'])
->condition('nr.revision_timestamp', strtotime('-1 months'), '<')
->groupBy('nr.nid')
->having('COUNT(nr.vid) > :revision_count', [':revision_count' => 4]);
$results = $query->execute();
$nids = $results->fetchCol();
if (!empty($nids)) {
$nodeRevisionDelete = \Drupal::service('node_revision_delete');
$nids_in_queue = $nodeRevisionDelete->getNidsInQueue();
foreach ($nids as $nid) {
if (($nid = (int) $nid) && !isset($nids_in_queue[$nid])) {
\Drupal::queue('node_revision_delete')->createItem($nid);
if (\Drupal::config('node_revision_delete.settings')->get('verbose_log')) {
\Drupal::logger('node_revision_delete')->info('Node @id was added to the Node Revision Delete queue.', ['@id' => $nid]);
}
}
}
}
}
}
Active
2.0
Code