Using T.A.C. 5.x-1.0 in an Drupal 5.1 environment, I installed and activated the taxonomy_access_control module (some vocabulary already existed) then I created some role; finally I added the first user of the website, and I received a *lot* of errors like this:

Duplicate entry '33-5' for key 1 query: INSERT INTO term_access VALUES (33, 5, 1, 0, 0, 1, 1) in [....]database.mysql.inc line 167.

Anyway the user was correctly created. When I created the second user, no more errors. Should I better use the *-dev version? Any idea about what happened?

Thanks
FB

Comments

francoud’s picture

Title: Duplicate entry » Duplicate entry (more)

I forgot: I use Mysql 5.0.37, PHP 5.2.1. Apache 2.2.4 in windows environment.

keve’s picture

Status: Active » Fixed

I commited a bugfix for duplicate entry to 5.x-dev.
Please test it by adding new user role, and than assigning a user to it.

francoud’s picture

Title: Duplicate entry (more) » Duplicate entry

First of all, I tried inverting the process: "first" I created roles and users (no errors), then I activated T.A.C (no errors): and all worked ok

OK, then I restored previous database (no roles and users still created), and downloaded the latest TAC (5.x-1.x-dev 2007-May-25). When I activated the module, I received these warning:

* warning: Invalid argument supplied for foreach() in D:\apache22\htdocs\drupal5\sites\all\modules\taxonomy_access\taxonomy_access.module on line 535.

* warning: Invalid argument supplied for foreach() in D:\apache22\htdocs\drupal5\sites\all\modules\taxonomy_access\taxonomy_access.module on line 589.

(this didn't happened with previous version...). OK anyway, I again created roles and users, and no errors. So, it seems that the latest patch solved the "duplicated entry" error. But maybe introduced this "foreach" error?

keve’s picture

Status: Fixed » Closed (fixed)

Commited new bugfix.