After enabling the module, the site says content access permissions need to be rebuilt. Trying to execute the task, I get:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /drupal-7/batch?render=overlay&id=27&op=do StatusText: Internal Server Error ResponseText: Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given, called in /var/www/aliases/drupal-7.0-rc2/sites/all/modules/book_access/book_access.module on line 359 and defined in db_query() (line 2179 of /var/www/aliases/drupal-7.0-rc2/includes/database/database.inc).

Regards,
TP

Comments

Anonymous’s picture

Title: Rebuilding content access permissions fails » A call to db_query() uses wrong parameters and doesn't pass the table name to db_escape_table()

The parameter passed to db_query() is not correct, and the table name passed to the function (which is passed as argument to the module function) should be passed to db_escape_table().

Anonymous’s picture

Status: Active » Fixed

I changed the code, and committed it to the development snapshot branch (both Drupal 6 and 7 versions).

Thanks for your report.

tpicado’s picture

Status: Fixed » Active

Thank you for the fix! However, now I get:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /drupal-7/batch?render=overlay&id=32&op=do StatusText: OK ResponseText: Fatal error: Call to undefined function db_fetch_object() in /var/www/aliases/drupal-7.0-rc2/sites/all/modules/book_access/book_access.module on line 364

Not sure if it's enough to replace the 'book_access.module' file with the new one...

Regards,
TP

Anonymous’s picture

Status: Active » Fixed

db_fetch_object() is not defined in Drupal 7; that is the reason of the error (I should have looked better to the code).

I have changed the code, and committed it to the develop snapshot. Thank you for the help with the issue.

tpicado’s picture

Status: Fixed » Active

Hi kiam,

Sorry I wasn't able to test this earlier. I can now have the permissions rebuilt, but when I access the UI page, I get:

Fatal error: __clone method called on non-object in /var/www/aliases/drupal-7.0-rc2/sites/all/modules/book_access/book_access_ui.admin.inc on line 20

I'm still on RC2, and have replaced only the 'book_access.module' and 'book_access.api.php' files.

Regards,
TP

Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

I fixed that with the latest commits I did for the development snapshot; the form builder functions were not updated to Drupal 7, and they were using an argument less.

I tested the latest developed code, and it works in my test site; please test on your own test site, and report any additional issues you find.

tpicado’s picture

Hi kiam,

So, after updating the UI files and the 'vars' module files, the user interface seems to be working fine. However, I now have the same issue that is being reported for version 6.x-1.0-rc6, "Role loses edit permissions", when a book page is edited.

Im my case, this is actually not just affecting the permissions for the role of a given user, but any other permissions defined (of type role or user), even if the user updating the content doesn't have permissions to administer access. Updating the book outline works fine, though.

Regards,
TP

tpicado’s picture

Status: Postponed (maintainer needs more info) » Active

(updating issue status)

Anonymous’s picture

Status: Fixed » Active

I cannot reproduce this issue.
Then, the actual issue is different from the originally reported one; this needs to be reported in a different issue.

Anonymous’s picture

Status: Active » Fixed

Status: Active » Closed (fixed)

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