From 9fe063022e08a4b6fa5f5935f8f185d5d95814a4 Mon Sep 17 00:00:00 2001 From: Sem Date: Wed, 25 Apr 2012 19:09:22 +0200 Subject: Upgraded to Elgg 1.8.4. --- engine/lib/access.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engine/lib/access.php') diff --git a/engine/lib/access.php b/engine/lib/access.php index dba1e1ec6..6be252c6a 100644 --- a/engine/lib/access.php +++ b/engine/lib/access.php @@ -671,8 +671,10 @@ function add_user_to_access_collection($user_guid, $collection_id) { return false; } + // if someone tries to insert the same data twice, we do a no-op on duplicate key $q = "INSERT INTO {$CONFIG->dbprefix}access_collection_membership - SET access_collection_id = {$collection_id}, user_guid = {$user_guid}"; + SET access_collection_id = $collection_id, user_guid = $user_guid + ON DUPLICATE KEY UPDATE user_guid = user_guid"; $result = insert_data($q); return $result !== false; -- cgit v1.2.3