You are here

function _revisioning_form_submit in Revisioning 6.4

Same name and namespace in other branches
  1. 8 revisioning.pages.inc \_revisioning_form_submit()
  2. 6.3 revisioning.pages.inc \_revisioning_form_submit()
  3. 7 revisioning.pages.inc \_revisioning_form_submit()

Handler for the 'Save' button on the edit form.

When saving a new revision we shouldn't redirect to "View current", as that's not the one we've saved. However at this stage, via the form, we don't know the vid of the newly created revision, only the vid of the revision we've just edited, so we get latest revision id from the database.

1 string reference to '_revisioning_form_submit'
revisioning_form_alter in ./revisioning.pages.inc
Implementation of hook_form_alter().

File

./revisioning.pages.inc, line 250
Rendering and altering of pages and forms used by Revisioning

Code

function _revisioning_form_submit($form, &$form_state) {
  $nid = $form['#node']->nid;
  if (!empty($nid)) {

    // don't redirect when creating new node
    $vid = revisioning_get_latest_revision_id($nid);
    $form_state['redirect'] = "node/{$nid}/revisions/{$vid}/view";
  }
}