You are here

function course_book_node_insert in Course 3.x

Same name and namespace in other branches
  1. 8.3 modules/course_book/course_book.module \course_book_node_insert()
  2. 8.2 modules/course_book/course_book.module \course_book_node_insert()
  3. 7.2 modules/course_book/course_book.module \course_book_node_insert()
  4. 7 modules/course_book/course_book.module \course_book_node_insert()

Implements hook_node_insert().

Resave the book course object associated with this book page.

We need to do this so that proper hooks get run to set content access.

File

modules/course_book/course_book.module, line 208

Code

function course_book_node_insert($node) {
  if (!empty($node->book['bid']) && $node->book['bid'] != $node
    ->id()) {
    if ($courseObject = course_get_course_object('book', $node->book['bid'])) {
      $courseObject
        ->save();
    }
  }
}