You are here

function diff_node_revisions_validate in Diff 6

Same name and namespace in other branches
  1. 5.2 diff.module \diff_node_revisions_validate()
  2. 5 diff.module \diff_node_revisions_validate()
  3. 6.2 diff.pages.inc \diff_node_revisions_validate()
  4. 7.3 diff.pages.inc \diff_node_revisions_validate()
  5. 7.2 diff.pages.inc \diff_node_revisions_validate()

Validation for input form to select two revisions.

File

./diff.module, line 217
Provides functionality to show a diff between two node revisions.

Code

function diff_node_revisions_validate($form, &$form_state) {
  $old_vid = $form_state['values']['old'];
  $new_vid = $form_state['values']['new'];
  if ($old_vid == $new_vid || !$old_vid || !$new_vid) {
    form_set_error('diff', t('Select different revisions to compare.'));
  }
}