In Drupal 7 hook_block_configure and hook_block_save provide a method to modify a blocks settings and save these values.
But how would I carry out validation on the form before saving the values?
In Drupal 7 hook_block_configure and hook_block_save provide a method to modify a blocks settings and save these values.
But how would I carry out validation on the form before saving the values?
If you wish to add validation for the whole form, this is not really possible. The best way I have managed to implement myself is to add a custom function to the code with $edit as a parameter with Boolean as a return value. Then call the function in the hook_block_save()
before saving data in order to perform the extra checks. Works fine with the only exception that it will not highlight in red values that are incorrect in the form.