// does not work, in book_nodeapi: case 'delete': if (isset($node->book)) { drupal_delete_add_callback( array('book_delete_post' => array($node->book),)); drupal_delete_add_query('DELETE FROM {book} WHERE mlid = %d', $node->book['mlid']); $form['node_'. $node->nid]['book_warning'] = array( '#value' => '
'. t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.' .'
', array('%title' => $node->title)), '#weight' => -10, ); drupal_delete_add_form_elements($form); } //works: function book_delete_pre($type, $id, $package_info) { $form = array(); if ($type == 'node' && is_numeric($id)) { $node = node_load($id); if (isset($node->book) && $node->book['has_children']) { $form['node_'. $node->nid]['book_warning'] = array( '#value' => ''. t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.' .'
', array('%title' => $node->title)), '#weight' => -10, ); } } return $form; }