Do not delete revisions with vid > current revision vid

duozersk - August 22, 2009 - 08:23
Project:Revision Deletion
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:duplicate
Issue tags:Roadmap
Description

As we got a really active maintainer now (really appreciate this), I have one more thing to think about.

If we have the revision moderation of any kind installed, then the newly created revision does to the moderation queue (not become current revision) and may stay there for quite a while. The vid of this newly created revision is bigger than the vid of the current revision. If the time comes to delete this newly created revision - we can loose it per the query that we have now in the revision deletion module:

  // Build data that does not pick current revision, nr.vid <> n.vid.
  $result = db_query('SELECT nr.nid, nr.vid, nr.timestamp, n.type, n.title '
    .'FROM {node_revisions} nr '
    .'INNER JOIN {node} n ON nr.nid = n.nid '
    .'WHERE nr.timestamp < %d AND nr.vid <> n.vid AND '. $conds .' '
//    .'ORDER BY vid',
    .'ORDER BY nr.nid, timestamp DESC ',
    $arguments);

I would suggest to make it "nr.vid < n.vid" in the WHERE clauses.

Thanks

#1

NancyDru - August 22, 2009 - 14:44
Status:active» postponed (maintainer needs more info)

Is this basically a duplicate of #359769: Better configuration or integration with revision tag module?

I'm not crazy about the test "nr.vid < n.vid" because of some other modules that allow for "portable" nids and vids.

#2

duozersk - August 24, 2009 - 11:32

Hey Nancy,

What do you mean by "portable" nids and vids... I don't seem to get it right :)

And as you wrote in the #359769: Better configuration or integration with revision tag module about the Revision Moderation - my initial request is exactly about this module. We are using it and it creates new revisions in moderation with vids > current revision vid.

Thanks for your time on this.

#3

NancyDru - August 24, 2009 - 13:47

"Portable" nids and vids is a technique to allow adding content to multiple sites and having the same nids and vids on each of them.

On most Drupal sites, the vid will be always increasing (even when you revert), so yes, your request makes sense in that light, but if the "portable" idea catches on, it might not because the nids and vids will be something more along the lines of an md5 hash of the content and may not follow that "always increasing" model.

When I get a few more things completed, I will be looking at Diff first, then the two modules mentioned in your post.

#4

NancyDru - August 31, 2009 - 18:39
Status:postponed (maintainer needs more info)» postponed

Added Roadmap tag

#5

NancyDru - August 31, 2009 - 18:42
Status:postponed» duplicate

Actually, it seems you agree that this is a dupliacte of #359769: Better configuration or integration with revision tag module, so marking this as duplicate.

 
 

Drupal is a registered trademark of Dries Buytaert.