You are here

function backup_migrate_schedule::edit_form_validate in Backup and Migrate 8.2

Same name and namespace in other branches
  1. 8.3 includes/schedules.inc \backup_migrate_schedule::edit_form_validate()
  2. 6.3 includes/schedules.inc \backup_migrate_schedule::edit_form_validate()
  3. 6.2 includes/schedules.inc \backup_migrate_schedule::edit_form_validate()
  4. 7.3 includes/schedules.inc \backup_migrate_schedule::edit_form_validate()
  5. 7.2 includes/schedules.inc \backup_migrate_schedule::edit_form_validate()

Submit the edit form.

Overrides backup_migrate_item::edit_form_validate

File

includes/schedules.inc, line 276

Class

backup_migrate_schedule
A schedule class for crud operations.

Code

function edit_form_validate($form, &$form_state) {
  if (!is_numeric($form_state['values']['period']['number']) || $form_state['values']['period']['number'] <= 0) {
    form_set_error('period][number', t('Backup period must be a number greater than 0.'));
  }
  if (!is_numeric($form_state['values']['keep']) || $form_state['values']['keep'] < 0) {
    form_set_error('keep', t('Number to keep must be an integer greater than or equal to 0.'));
  }
  parent::edit_form_validate($form, $form_state);
}