Hey everyone,
I just tried out the latest ACL 7.x-1.x-dev snapshot with the Content Access 7.x version found at http://drupal.org/node/690610 (comment #9). When I tried to view a node's access control page (the "Access control" tab when viewing a node), I received the following error message (and the page was unaccessible):
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'grant_update' at row 1: INSERT INTO {acl_node} (acl_id, nid, grant_view, grant_update, grant_delete, priority) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => 2 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => 0 ) in acl_node_add_acl() (line 96 of /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/acl/acl.module).
I can confirm that this error message only occurs with the ACL module enabled. If the ACL module isn't enabled, I'm able to successfully view the node's "Access Control" page.
Any ideas about the meaning of this error and how to fix it?
Thanks,
Ben
Comment | File | Size | Author |
---|---|---|---|
#9 | Screen Shot 2014-01-11 at 23.46.58.png | 75.53 KB | Bojhan |
#2 | content_access.admin_.inc_.txt | 17.32 KB | BenK |
#2 | content_access.module.txt | 17.27 KB | BenK |
Comments
Comment #1
salvisHow is acl_node_add_acl() called from CA? It seems it's passed NULL rather than 0.
It's too bad atchijov zips his files — I'd look inside if he didn't...
Comment #2
BenK CreditAttribution: BenK commentedHey salvis,
I took a loot at the content_access.admin.inc file contained in atchijov's zip file and here's the code I found:
Any thoughts on what needs to be fixed?
In case you want to look at the entire content_access.admin.inc file (or the content_access.module file), I have attached them to this comment. I had to switch their extension to .txt so I could upload them.
Thanks for your help with this!
--Ben
Comment #3
salvisHmm, then it seems to be FALSE rather than NULL that is not accepted.
Please try
The grants should be ints (i.e. 0 or 1). If it turns out that this change fixes the problem, then I'll add the casts in ACL to make it more robust.
Comment #4
BenK CreditAttribution: BenK commentedHey salvis,
I made the change you suggested in #3, but I got a white screen of death. Looking in the error logs, this was the new error message:
PHP Fatal error: Call to undefined function db_result() in /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/acl/acl.admin.inc on line 16, referer: http://sandbox10.testsite.org/node/2
Any ideas?
Thanks,
Ben
Comment #5
salvisAh, this means we're making progress — you got past the error in the OP! :-)
Please reopen #798106: Updated queries for drupal 7 which was supposed to remove all calls to db_result(), and report the error message there.
Comment #6
BenK CreditAttribution: BenK commentedHey salvis,
As you suggested, I just cross-posted the error message in #4 at http://drupal.org/node/798106. See you over in that issue thread...
--Ben
Comment #7
good_man CreditAttribution: good_man commentedI think this issue is fixed with the latest ACL and Content Access, if not reopen it please.
Comment #8
Bojhan CreditAttribution: Bojhan commentedI'm getting this error. Seems like it is still occuring
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '318-16-acl' for key 'PRIMARY': INSERT INTO {node_access} (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5), (:db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11); Array ( [:db_insert_placeholder_0] => 318 [:db_insert_placeholder_1] => acl [:db_insert_placeholder_2] => 16 [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 318 [:db_insert_placeholder_7] => content_access_rid [:db_insert_placeholder_8] => 3 [:db_insert_placeholder_9] => 1 [:db_insert_placeholder_10] => 0 [:db_insert_placeholder_11] => 0 ) in node_access_write_grants() (line 3548 of node/node.module).
Small note, I get this when I want to set the user value of a user reference field. Frank, I get this with all of my fields (I am using set_data_value).
The way to reproduce this, is to use the rules and set a data value - you will notice this throws a integrity constraint violation.
Comment #9
Bojhan CreditAttribution: Bojhan commentedComment #10
salvis@Bojhan:
Put a breakpoint into node_access_write_grants() and check where it's being called from. It should only be called by core (from node_access_acquire_grants() if memory serves right), NOT by any contrib.
This does not seem to correspond to the subject of this thread.
Comment #11
gisleThis issue has not received any updates in the previous 6 years. If you believe it to still be relevant, you are encouraged to reopen the issue and update it.