function node_revision_delete_update_7300 in Node Revision Delete 7.3
Update the configurations to the 3.x module version.
File
- ./
node_revision_delete.install, line 82 - Install, update and uninstall functions for the Node Revision Delete module.
Code
function node_revision_delete_update_7300() {
// Creating new variables.
// Time configuration to know when the revision should be deleted.
$node_revision_delete_when_to_delete_time = array(
'max_number' => 12,
'time' => 'months',
);
variable_set('node_revision_delete_when_to_delete_time', $node_revision_delete_when_to_delete_time);
// Time configuration to know the minimum age that the revision should have
// to be deleted.
$node_revision_delete_minimum_age_to_delete_time = array(
'max_number' => 12,
'time' => 'months',
);
variable_set('node_revision_delete_minimum_age_to_delete_time', $node_revision_delete_minimum_age_to_delete_time);
$node_revision_delete_track = array();
// Searching the content type machine name.
$results = db_query("SELECT SUBSTR(name, 28) as name\n FROM {variable}\n WHERE name LIKE 'node_revision_delete_track_%'");
foreach ($results as $content_type) {
// Convert variables. Leave out untracked content types.
if (variable_get('node_revision_delete_track_' . $content_type->name)) {
$node_revision_delete_track[$content_type->name]['minimum_revisions_to_keep'] = variable_get('node_revision_delete_number_' . $content_type->name);
$node_revision_delete_track[$content_type->name]['minimum_age_to_delete'] = 0;
$node_revision_delete_track[$content_type->name]['when_to_delete'] = 0;
}
// Deleting old variables.
variable_del('node_revision_delete_track_' . $content_type->name);
variable_del('node_revision_delete_number_' . $content_type->name);
}
// Saving the new format.
variable_set('node_revision_delete_track', $node_revision_delete_track);
}