Download & Extend

Undefined property: stdClass::$book

Project:Advanced Book Blocks
Version:6.x-2.5
Component:Code
Category:bug report
Priority:normal
Assigned:Andrew_Mallis
Status:needs review

Issue Summary

I noticed PHP complaining on pressflow:

WD php: Notice: Undefined property: stdClass::$book in advancedbookblocks_nodeapi() (line 564 of                            [error]
/path/to/drupal/sites/all/modules/advancedbookblocks/advancedbookblocks.module).

and it seems to me that

function advancedbookblocks_nodeapi(&$node, $op) {
 
  $bid = $node->book['bid'];
  // doing its thing
}

should make sure that we are on a book node before it does its thing, like so:

function advancedbookblocks_nodeapi(&$node, $op) {
   
  //check to see if node is a book
  if (!empty($node->book['bid'])) {
    //doing its thing
  }
}

I've attached a patch to the point.

AttachmentSize
advancedbookblocks.module.patch1.03 KB

Comments

#1

hello?

#2

Ran into same issue. The first hunk of your patch changes line 102, which I don't think is directly related to this issue? Otherwise patch seems to do what's needed.

nobody click here