I'm trying to get the Book Access Module (http://drupal.org/project/book_access) running with my Drupal installation... using the RC1 build of the SQL driver. The error message comes about when I attempt to go to the Book Access UI, where I get the following error message:

PDOException: SQLSTATE[07002]: 
[Microsoft][SQL Server Native Client 10.0]COUNT field incorrect or syntax error: 
SELECT TOP(1) module FROM {variable_default} 
WHERE name = :name OR (:name LIKE CONCAT(name, '\_%') AND flags > 0); 
Array ( [:name] => book_access_default_authors_access ) 
in Vars->offsetGet() (line 286 of E:\content\sites\all\modules\vars\vars.module).

I'm not extremely familiar with the limitations of SQL vs. MySQL, but I'm guessing there's incompatible syntax at work here. I'm just not sure where.

Comments

damien tournoud’s picture

Project: Drupal driver for SQL Server and SQL Azure » Book access
Version: 7.x-1.0-rc1 » 7.x-2.x-dev
Category: support » bug

This query uses the :name placeholder twice, which is invalid in PDO. It seems that it can work on MySQL, but it is invalid nonetheless. Tentatively reassigning to the Book access project as a bug.

Ryan S’s picture

Project: Book access » Variable API
Version: 7.x-2.x-dev » 7.x-2.0-alpha4

This has been sitting in the Book Access mod queue, but it's really more of an issue with the Variable API, since that is where :name is being used twice.

Anonymous’s picture

Status: Active » Fixed

I have changed the code, and I will soon create a new official release.

Thank for the report, and the trick about PDO placeholders.

ursula’s picture

Version: 7.x-2.0-alpha4 » 7.x-2.0-alpha5
Priority: Normal » Major
Status: Fixed » Active

Sorry, changed the status to active again.
I just applied the alpha5 update, and it broke the book_access module, see:
http://drupal.org/node/1265768


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

Also: The alpha5 update doesn't include the CHANGELOG.

Ursula

Anonymous’s picture

Status: Active » Fixed

This has been fixed in the 7.x-2.0-alpha6 version. Clearly, moving a class to a file that didn't exist before doesn't allow Drupal to find the class.

The CHANGELOG.txt file is not included anymore.

ursula’s picture

The problem still exists for me in 7.x.-2.0-alpha6 and alpha7, but I figured out a work-around (see http://drupal.org/node/1265768).

Status: Fixed » Closed (fixed)

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