When looking for grant records of a book page node, a notice can show up if $node->book['bid'] is not set. This patch checks that node->type equals to 'book' in book_access_node_access_records(), enforces the isset($node->book['bid']), and fixes the signature.

The testcase I'm working on includes test for this issue. Probably all book page nodes include ->book['bid'], but creating a book page using node_save it may happen that book module does not create a complete ->book structure (possible core bug I'll post a follow up here), and this module shows a notice.

Comments

ilo’s picture

I just realized other content types could also be configured to be child pages, so I revert the 'book' type enforce. The other changes are included in the patch.

avpaderno’s picture

Status: Needs review » Fixed

The patch has been applied, and the code committed in CVS.

Thanks for your very appreciated help.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.