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

rdeboer’s picture

Assigned: Unassigned » rdeboer

Excellent idea Georgii!
Rik

rdeboer’s picture

Status: Needs review » Fixed

Finally checked this in, with attribution. Your first commit Georgii!
Sorry for the delay.
Rik

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Russian language removed.