I get a lot of PHP errors of the form:

Duplicate entry '537-16' for key 1 query: INSERT INTO users_roles (uid, rid) VALUES (537, 16) in includes/database.mysql.inc on line 172.

This is caused by the INSERT query in _ldapgroups_grant_role(). Though the SELECT query returns 0 rows, the INSERT query a couple of lines later still fails. I believe this happens if a user attempts to open multiple pages in different browser tabs at the same time.

Would it be possible to do a diff on the user's roles instead of removing them all and adding them all back? Seems like a lot of excess database work (two SELECTs, an INSERT, and a DELETE *per role*) where a single SELECT would cover the most common case (a user without different roles logs in).

I've inserted an IGNORE in the INSERT query to stop the PHP errors for now.

Comments

johnbarclay’s picture

Status: Active » Closed (won't fix)

Closing 5.x issues to clean out issue queue.