Download & Extend

List page not honoring selection rules

Project:Revision Deletion
Version:6.x-1.0-rc2
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:needs review

Issue Summary

My selection rules are reported correctly on the List page:

* If the current revision was created less than 1 week ago, the next older revision will be kept.
* It will delete revisions that are older than 1 week.

However, the List page lists revisions as subject to deletion that do not meet the selection criteria (and will, in fact, delete them). For instance, today, I modified two nodes, and then accessed the Revisions to Mass Delete > List page. It listed all of the previous revisions for both nodes as subject to deletion. (The previous revisions were all over 1 week old, but the current revisions had been created only minutes earlier.)

Am I missing something? The module seems to be deleting all non-current revisions, regardless of the selection rules.

Comments

#1

Status:active» needs review

Confirmed...

I took the query from revision_deletion_get_list() directly into the database and it does not produced the expected result.

Expected:
SELECT n.title, r.nid, r.vid, r.timestamp, r.uid, r.log, n.type, n.vid AS current, n.status FROM {node_revisions} r INNER JOIN {node} n ON r.nid = n.nid WHERE n.nid IN (SELECT r.nid FROM {node_revisions} r INNER JOIN {node} n ON r.nid = n.nid AND r.vid <> n.vid WHERE r.timestamp < %d $conds ) ORDER BY r.nid, r.timestamp DESC

The bold WHERE clause should filter the result set by $aged timestamp value.

Result:
It does not. It returns all revisions regardless of timestamp or revision_delete_age setting.

Attached is patch to fix It is lightly tested.

AttachmentSize
revision_deletion-get_list_query.patch 1.39 KB