I just tried this module, and get this error when trying to allow view access to an Access Group:
user warning: Duplicate entry '25' for key 1 query: INSERT INTO simple_access_node (`nid`, `gid`, `view`, `update`, `delete`) VALUES (25, 2, 0, 0, 0) in /home/blahblah/public_html/includes/database.mysql.inc on line 172.
It turns out that this row had been successfully inserted:
nid 25
gid 1
view 1
update 0
delete 0
Then it tried to insert another row, with nid=25 again. But, nid is the primary key, so the result was of course a duplicate entry.
And here is something else which makes me wonder if 5.x-1.1 is ready for prime time. simple_access.install contains this for PostgreSQL:
case 'pgsql':
db_query("CREATE TABLE {simple_access_groups} (
nid integer unsigned NOT NULL default '0',
gid integer unsigned NOT NULL default '0',
view integer unsigned NOT NULL default '0',
update integer unsigned NOT NULL default '0',
delete integer unsigned NOT NULL default '0',
);");
db_query("CREATE TABLE {simple_access_groups} (
gid serial NOT NULL,
name varchar(50) NOT NULL default '',
weight integer NOT NULL default '0'
);");
db_query("CREATE TABLE {simple_access_roles} (
gid integer NOT NULL default '0',
rid integer NOT NULL default '0'
);");
break;
The first table being created should be simple_access_node, not simple_access_groups. simple_access_groups is created twice!
Comments
Comment #1
darumaki commentedI was just going to post something about this, same thing is happening to me, wish this module was fixed once and for all,
Comment #2
gordon commentedHad the primary key set up wrong.
Comment #3
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.