I'm fairly new to things Drupal so apologies in advance if this is wasting anyone's time.
I was exercising the ACL functions with the forum_access module and continuously received SQL syntax errors. The culprit appears to be in node_access_write_grants() in the block starting at line 2868 where the grant inserts are built up. The finished statement ends up taking the form:
INSERT INTO {node_access} (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (a1, a2, a3, a4, a5), (b1, b2, b3, b4, b5)
as opposed to the correct (in SQL anyway) form:
INSERT INTO {node_access} (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (a1, a2, a3, a4, a5);
INSERT INTO {node_access} (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (b1, b2, b3, b4, b5);
The fix is obvious and instant. Hope this is useful.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | write-grants.patch | 1.78 KB | Steven |
Comments
Comment #1
Steven commentedFor now, we should stick to standard SQL. Patch attached which simplifies the code and uses normal inserts.
Perhaps a multi-insert mechanism can be devised for 6.0.
Comment #2
dries commentedCode looks good but we'll want some of the node-level access gurus to test it! :)
Comment #3
drummTested with organic groups and committed to HEAD.
Comment #4
(not verified) commented