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
Comment #1
damien tournoud commentedThis 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.
Comment #2
Ryan S commentedThis 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.
Comment #3
Anonymous (not verified) commentedI have changed the code, and I will soon create a new official release.
Thank for the report, and the trick about PDO placeholders.
Comment #4
ursula commentedSorry, 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
Also: The alpha5 update doesn't include the CHANGELOG.
Ursula
Comment #5
Anonymous (not verified) commentedThis 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.
Comment #6
ursula commentedThe 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).