This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/vendor/chi-teck/drupal-code-generator/templates/d7/hook/validate.twig
2018-11-23 12:29:20 +00:00

11 lines
280 B
Twig

/**
* Implements hook_validate().
*/
function {{ machine_name }}_validate($node, $form, &$form_state) {
if (isset($node->end) && isset($node->start)) {
if ($node->start > $node->end) {
form_set_error('time', t('An event may not end before it starts.'));
}
}
}