function book_pick_book_nojs_submit

Same name in other branches
  1. 7.x modules/book/book.module \book_pick_book_nojs_submit()
  2. 9 core/modules/book/book.module \book_pick_book_nojs_submit()
  3. 8.9.x core/modules/book/book.module \book_pick_book_nojs_submit()
  4. 11.x core/modules/book/book.module \book_pick_book_nojs_submit()

Form submission handler for node_form().

This handler is run when JavaScript is disabled. It triggers the form to rebuild so that the "Parent item" options are changed to reflect the newly selected book. When JavaScript is enabled, the submit button that triggers this handler is hidden, and the "Book" dropdown directly triggers the book_form_update() Ajax callback instead.

See also

book_form_update()

book_form_node_form_alter()

1 string reference to 'book_pick_book_nojs_submit'
book_form_node_form_alter in core/modules/book/book.module
Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.

File

core/modules/book/book.module, line 193

Code

function book_pick_book_nojs_submit($form, FormStateInterface $form_state) {
    $node = $form_state->getFormObject()
        ->getEntity();
    $node->book = $form_state->getValue('book');
    $form_state->setRebuild();
}

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