diff options
Diffstat (limited to 'modules/book/book.module')
-rw-r--r-- | modules/book/book.module | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/modules/book/book.module b/modules/book/book.module index 4d81375e6..11b11d258 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -343,7 +343,12 @@ function book_form_alter(&$form, $form_state, $form_id) { $form['book']['pick-book'] = array( '#type' => 'submit', '#value' => t('Change book (update list of parents)'), - '#submit' => array('book_pick_book_submit'), + // Submit the node form so the parent select options get updated. + // This is typically only used when JS is disabled. Since the parent options + // won't be changed via AJAX, a button is provided in the node form to submit + // the form and generate options in the parent select corresponding to the + // selected book. This is similar to what happens during a node preview. + '#submit' => array('node_form_submit_build_node'), '#weight' => 20, ); } @@ -351,23 +356,6 @@ function book_form_alter(&$form, $form_state, $form_id) { } /** - * Submit the node form so the parent select options get updated. - * - * This is typically only used when JS is disabled. Since the parent options - * won't be changed via AJAX, a button is provided in the node form to submit - * the form and generate options in the parent select corresponding to the - * selected book. This is similar to what happens during a node preview. - */ -function book_pick_book_submit($form, &$form_state) { - // Unset any button-level handlers, execute all the form-level submit functions - // to process the form values into an updated node, and rebuild the form. - unset($form_state['submit_handlers']); - form_execute_handlers('submit', $form, $form_state); - $form_state['rebuild'] = TRUE; - $form_state['node'] = $form_state['values']; -} - -/** * Build the parent selection form element for the node form or outline tab * * This function is also called when generating a new set of options during the |