Merge pull request #4564 from annando/avoid-duplicate
Avoid SQL errors due to duplicate entries in the "participation" table
This commit is contained in:
commit
3ecc53b448
|
@ -2211,7 +2211,10 @@ class Diaspora
|
||||||
}
|
}
|
||||||
|
|
||||||
logger('Received participation for ID: '.$item['id'].' - Contact: '.$contact_id.' - Server: '.$server, LOGGER_DEBUG);
|
logger('Received participation for ID: '.$item['id'].' - Contact: '.$contact_id.' - Server: '.$server, LOGGER_DEBUG);
|
||||||
dba::insert('participation', ['iid' => $item['id'], 'cid' => $contact_id, 'fid' => $person['id'], 'server' => $server]);
|
|
||||||
|
if (!dba::exists('participation', ['iid' => $item['id'], 'server' => $server])) {
|
||||||
|
dba::insert('participation', ['iid' => $item['id'], 'cid' => $contact_id, 'fid' => $person['id'], 'server' => $server]);
|
||||||
|
}
|
||||||
|
|
||||||
// Send all existing comments and likes to the requesting server
|
// Send all existing comments and likes to the requesting server
|
||||||
$comments = dba::p("SELECT `item`.`id`, `item`.`verb`, `contact`.`self`
|
$comments = dba::p("SELECT `item`.`id`, `item`.`verb`, `contact`.`self`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user