I'm currently getting following message on all 'Administer' pages (in 6.x-dev with Garland):
notice: Trying to get property of non-object in D:\www\formdev.com\cms\modules\book\book.module on line 187.
It occurred after enabling the Book module and adding the 'Book navigation' block to the left sidebar. If I remove the book navigation block from the sidebar, the error is gone.
Here is the call stack:
book_block() cms/modules/book/book.module at line 187
book_block() cms/modules/book/book.module at line 176
module_invoke() cms/includes/module.inc at line 450
module_invoke() cms/includes/module.inc at line 443
block_list() cms/modules/block/block.module at line 446
block_list() cms/modules/block/block.module at line 388
theme_blocks() cms/includes/theme.inc at line 1487
theme_blocks() cms/includes/theme.inc at line 1484
theme() cms/includes/theme.inc at line 591
theme() cms/includes/theme.inc at line 552
template_preprocess_page() cms/includes/theme.inc at line 1681
template_preprocess_page() cms/includes/theme.inc at line 1668
theme() cms/includes/theme.inc at line 632
theme() cms/includes/theme.inc at line 552
cms/index.php at line 36
cms/index.php at line 15
cms/indexx.php at line 10
Comments
Comment #1
scoutbaker commentedUsing the latest D6 HEAD, I was not able to reproduce this following the steps provided. I created multiple books and book pages. I've also tried the block in both the left and right sidebars.
Comment #2
ktauber commented... but if you look at the code in book.module (lines 183-187), you can see that $node is not initialized if the path is != 'node/123'. I'm new to Drupal, so I don't know why it occurs on my site. But IMO there is something wrong with this code.
Comment #3
gábor hojtsyThe book block either works on a certain book's pages or on all pages. Unfortunately the book ID check was also done on non-book pages. Untested patch attached. I moved the current_bid code inside the node existence check so it should eliminate the non-object problem. I also did a small cleanup here, removed one temp variable which was not needed at all.
Comment #4
ktauber commentedThe patch fixed the problem form me ;) Thanks
Comment #5
jody lynnTested and reviewed patch.
Comment #6
gábor hojtsyThanks for testing, committed.
Comment #7
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.