Permalink
Browse files

fix(relationships): prevent sql exception on duplicate relationships …

…race condition

Fixes #9179
  • Loading branch information...
beck24 authored and mrclay committed Dec 20, 2015
1 parent ea4c7fe commit 9e469da988d288969706ef61970e2044a442d162
Showing with 1 addition and 0 deletions.
  1. +1 −0 engine/classes/Elgg/Database/RelationshipsTable.php
@@ -112,6 +112,7 @@ function add($guid_one, $relationship, $guid_two) {
INSERT INTO {$this->db->getTablePrefix()}entity_relationships
(guid_one, relationship, guid_two, time_created)
VALUES ($guid_one, '$relationship', $guid_two, $time)
ON DUPLICATE KEY UPDATE time_created = $time
");
if (!$id) {
return false;

0 comments on commit 9e469da

Please sign in to comment.