function backup_migrate_schedule::edit_form_validate in Backup and Migrate 8.3
Same name and namespace in other branches
- 8.2 includes/schedules.inc \backup_migrate_schedule::edit_form_validate()
- 6.3 includes/schedules.inc \backup_migrate_schedule::edit_form_validate()
- 6.2 includes/schedules.inc \backup_migrate_schedule::edit_form_validate()
- 7.3 includes/schedules.inc \backup_migrate_schedule::edit_form_validate()
- 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 561 - All of the schedule handling code needed for Backup and Migrate.
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 (!$form_state['values']['delete']) {
$form_state['values']['keep'] = 0;
}
else {
if ($form_state['values']['deletetype'] == BACKUP_MIGRATE_SMART_DELETE) {
$form_state['values']['keep'] = BACKUP_MIGRATE_SMART_DELETE;
}
else {
if (!is_numeric($form_state['values']['keep']) || $form_state['values']['keep'] <= 0) {
form_set_error('keep', t('Number to keep must be a number greater than 0.'));
}
}
}
parent::edit_form_validate($form, $form_state);
}