function node_test_form_alter

Same name in other branches
  1. 9 core/modules/node/tests/modules/node_test/node_test.module \node_test_form_alter()
  2. 8.9.x core/modules/node/tests/modules/node_test/node_test.module \node_test_form_alter()
  3. 10 core/modules/node/tests/modules/node_test/node_test.module \node_test_form_alter()

Implements hook_form_alter().

File

core/modules/node/tests/modules/node_test/node_test.module, line 186

Code

function node_test_form_alter(&$form, FormStateInterface $form_state, $form_id) {
    if (!$form_state->get('node_test_form_alter')) {
        \Drupal::messenger()->addStatus('Storage is not set');
        $form_state->set('node_test_form_alter', TRUE);
    }
    else {
        \Drupal::messenger()->addStatus('Storage is set');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.