1 book.module book_node_presave(Node $node)

Implements hook_node_presave().

File

core/modules/book/book.module, line 888
Allows users to create and organize related content in an outline.

Code

function book_node_presave(Node $node) {
  // Always save a revision for non-administrators.
  if (!empty($node->book['bid']) && !user_access('administer nodes')) {
    $node->revision = 1;
  }
  // Make sure a new node gets a new menu link.
  if (empty($node->nid)) {
    $node->book['mlid'] = NULL;
  }
}