The bug is in function revisioning_delete_archived_revisions from revisioning_api.inc.
function revisioning_delete_archived_revisions($node) {
return db_delete('node_revision')
->condition('nid', $node->nid)
->condition('vid', $node->current_revision_id, '<')
->execute();
}
It cleans only the 'node_revision' table leaving all the 'field_revision' tables untouched with unreferenced revisions of fields. I'd suggest changing this function to reuse standard functionality from node.module:
/**
* Delete all revisions with a vid less than the current.
* Use node_revision_delete from node.module to ensure that we cleanup not
* only node revisions but also all attached field revisions as well.
*/
function revisioning_delete_archived_revisions($node) {
$revisions = db_select('node_revision', 'n')
->fields('n', array('vid'))
->condition('n.nid', $node->nid)
->condition('n.vid', $node->current_revision_id, '<')
->execute();
foreach ($revisions as $rev) {
node_revision_delete($rev->vid);
}
}
Comments
Comment #1
rdeboerExcellent idea Georgii!
Rik
Comment #2
rdeboerFinally checked this in, with attribution. Your first commit Georgii!
Sorry for the delay.
Rik
Comment #3.0
(not verified) commentedRussian language removed.