I have a problem with a query that doesn't give any error during the normal execution of the module, but it gives problems while executing the tests for the module.

I have to change the code from

  $results = db_query(
    "SELECT nid FROM {node_access} WHERE realm = 'book_access' AND gid IN (" . db_placeholders($roles, 'int') . ") AND grant_update > 0",
    $roles
  );

to

  $results = db_query(
    "SELECT nid FROM {node_access} WHERE realm = 'book_access' AND gid IN (%s) AND grant_update > 0",
    implode(', ', $roles)
  );

in order to not get any errors from the tests.

Is that a know issue, or am I doing anything wrong?

To notice that the error message shows only part of the query (SELECT nid FROM {node_access} WHERE realm = 'book_access' AND gid IN (, while it should be supposed to show all the query.

Comments

avpaderno’s picture

Status: Active » Fixed

I changed the query back to as it was before, and I don't get any error anymore.
I don't know why, but it is now working as it should.

Status: Fixed » Closed (fixed)

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