action_example_node_sticky_action_validate

  1. drupal
    1. 8
    2. 7
Versions
8 – 7 action_example_node_sticky_action_validate($form, $form_state)

Validates settings form for action_example_node_sticky_action(). Verifies that user exists before continuing.

Related topics

Code

examples/action_example/action_example.module, line 314

<?php
function action_example_node_sticky_action_validate($form, $form_state) {
  if (! $account = user_load_by_name($form_state['values']['author']) ) {
    form_set_error('author', t('Please, provide a valid username'));
  }
}
?>