Skip to content

Commit

Permalink
fix(relationships): prevent sql exception on duplicate relationships …
Browse files Browse the repository at this point in the history
…race condition

Fixes #9179
  • Loading branch information
beck24 authored and mrclay committed Dec 21, 2015
1 parent ea4c7fe commit 9e469da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions engine/classes/Elgg/Database/RelationshipsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9e469da

Please sign in to comment.