When a user with no create book pages rights edits the top level page of a book to which he has Edit pages in this book rights, the following error is displayed:

warning: Invalid argument supplied for foreach() in /my/drupal/path/modules/book_access/book_access.module on line 363.

Debugging book_access.module revealed that the $options array/reference being passed to _book_access_restrict_options was empty/undefined.

Modifying the function to exit if the $options array was empty/undefined seems to resolve the issue. I accomplished this by changing line 345 from:
if ($user->uid == 0 || user_access('administer nodes')) {
to
if ($user->uid == 0 || user_access('administer nodes') || !$options) {

Envrionment
Drupal v5.7 on PHP 5.2.3

Modules:
LDAP Integration
Events
Edit Authoring Information
FCKEditor

The user being tested with is a regular drupal user (not uid 1) and has very few rights beyond editing one book and view rights to the site.

Comments

punchmonkey’s picture

Status: Needs review » Closed (duplicate)

Duplicated issue.

I was apparently filtering out closed issues when checking to see if this issue has already been raised.