Hi, first of all, really great module, but I'm getting this error when I'm trying to view my book as a slideshow in 4.7.x:

Fatal error: Call to undefined function: _book_get_depth() in ../modules/s5/s5_book.module on line 52

Comments

ak’s picture

The function _book_get_depth() does'nt exist in the module file, not in the 4.7 version neither in the cvs version of the module and it's no drupal core function either. It probably got lost on it's way somehow.

gábor hojtsy’s picture

Status: Active » Closed (fixed)

Fixed the module code. The _book_get_depth() function was part of Drupal core, but was removed in a book module refactoring before the 4.7 release. My code did not follow this change. I have applied this fix:

 function s5_book_export($nid = 0) {
   global $base_url;
   $nid = (int) $nid;
-  $depth = _book_get_depth($nid);
   $node = node_load($nid);
+  $depth = count(book_location($node)) + 1;
   // Template variables to fill into the file

Feel free to wait for the new download, or fix your module with this simple patch. Further feedback on the module is welcome!

ak’s picture

Could'nt wait, applied it and issue is solved. Great.