function node_revision_delete_confirm_submit

Form submission handler for node_revision_delete_confirm().

File

modules/node/node.pages.inc, line 670

Code

function node_revision_delete_confirm_submit($form, &$form_state) {
    $node_revision = $form['#node_revision'];
    node_revision_delete($node_revision->vid);
    watchdog('content', '@type: deleted %title revision %revision.', array(
        '@type' => $node_revision->type,
        '%title' => $node_revision->title,
        '%revision' => $node_revision->vid,
    ));
    drupal_set_message(t('Revision from %revision-date of @type %title has been deleted.', array(
        '%revision-date' => format_date($node_revision->revision_timestamp),
        '@type' => node_type_get_name($node_revision),
        '%title' => $node_revision->title,
    )));
    $form_state['redirect'] = 'node/' . $node_revision->nid;
    if (db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid', array(
        ':nid' => $node_revision->nid,
    ))
        ->fetchField() > 1) {
        $form_state['redirect'] .= '/revisions';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.