After today's update of the vars module, the book_access module broke with this error message:

PHP Fatal error:  Class 'Vars' not found in /home/upsites/wwwdev/sites/all/modules/book_access/book_access.module on line 650

I won't have time to look at it more closely until after the weekend, but on a quick look, seems like the vars module got restructured quite a bit (upgrade from "7.x-2.0-alpha4" to "7.x-2.0-alpha5").
I'll also log this in the vars issue queue.

Ursula

CommentFileSizeAuthor
#6 Modules | Drupal.png45.42 KBAnonymous (not verified)

Comments

Anonymous’s picture

Status: Active » Fixed

It has been fixed on the latest release of the Variable API module.

Jooblay.net’s picture

Status: Fixed » Active

We are stilling getting the same error as above:

{PHP Fatal error: Class 'Vars' not found in /home/upsites/wwwdev/sites/all/modules/book_access/book_access.module on line 650}

drupal 7.7

???

anyone?

Anonymous’s picture

Status: Active » Fixed

This is a bug for the Variable API module.
As far as I know, it has been already fixed. Update to the latest version of that module.

Jooblay.net’s picture

Variable API (Installed)7.x-2.0-alpha4 (Updated New Version)7.x-2.0-alpha7 (Release notes) When installed throws: {PHP Fatal error: Class 'Vars' not found in /home/upsites/wwwdev/sites/all/modules/book_access/book_access.module on line 650}

We went back in and re-installed the Variable API (Installed)7.x-2.0-alpha4 from back-up and now things are back to normal and all systems are stable.

So we are not sure on the conflict?

While we were getting the white screen of death from the fatal error we tried a boot strap in the index.php file:

/**
*registry_rebuild();
*/

[Note: On the registry_rebuild(); this has been effective with a host of Fatal Errors: in drupal, use sparingly but bravely. Once you hit your site after saving the file change the index.php file back.]

and tried installing the new Variable API (Updated New Version)7.x-2.0-alpha7 (Release notes) both from drupal update in 7.7 and the Variable module page http://drupal.org/project/vars its self on drupal but now luck. Finally we went for the back-up vars and are now back where we started.

So in closing we are not sure if the new version of Variable API has the patch as of this morning Sept. 3rd the new Variable API is still did not work:)

Darwin:)
DrupalUp Nasty

ursula’s picture

Issue tags: +bug workaround

For me, the problem occurred while using drush (I don't update using the interface). I am using the newest version (drupal 7.8 and today's version of the modules). Below is a workaround.

drush up 
Project vars was updated successfully. Installed version is now 7.x-2.0-alpha7.
Backups were saved into the directory /home/mysite/drush-backups/booktest/20110904000538/modules/vars.                                                    [ok]
The external command could not be executed due to an application error.                                                                                    [error]
Drush command terminated abnormally due to an unrecoverable error.                                                                                         [error]
Error: Class 'Vars' not found in /home/upsites/booktest/sites/all/modules/book_access/book_access.module, line 650

When I, however, first disabled the book_access module, then updated vars, then re-enabled the book_access module after fixing the vars dependency line (see below), everything went fine (except I had to rebuild permissions).

--- sites/all/modules/book_access/book_access.info      2011-01-24 03:04:15.000000000 -0800
+++ sites/all/modules/book_access_fixed/book_access.info        2011-09-03 16:56:09.000000000 -0700
@@ -5,7 +5,7 @@ description = Allows setting the access 
 package = Access control
 core = 7.x
 dependencies[] = book
-dependencies[] = vars (2.x)
+dependencies[] = vars (>=2.0-alpha4)
 files[] = book_access.module
 files[] = book_access.test
Anonymous’s picture

Priority: Critical » Major
StatusFileSize
new45.42 KB

The workaround doesn't work if you install a module using the Drupal interface.

If I change the dependency from "vars (2.x)" to "vars (>=2.0)," what I get is that Drupal doesn't allow me to enable the Book access module because it's not compatible with the Variable API 7.x-2.0-alpha7.

ursula’s picture

Issue tags: -bug workaround

@kiam:Thanks, the patch indeed didn't't work. I edited my previous comment, and replaced (>=2.0) with the full version (vars (>=2.0-alpha4) ). Now, the patch allows enabling of book_access through drush and also through the interface.

The workaround for the main upgrade problem (First: disable the book_access module, then update vars, then re-enable the book_access module.) should work when using the interface, without changing the dependency entry in book_access.info.

Jooblay.net’s picture

Good call ursula :) this did the trick in both drupal 7.7 and 7.8 installs.
Use the instructions from #7. Thanks

DrupalUP

Status: Fixed » Closed (fixed)

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