Avoid "duplicate entry" error
This commit is contained in:
parent
a1e2794c64
commit
73e36b64e6
1 changed files with 3 additions and 1 deletions
|
@ -125,9 +125,11 @@ class Tag
|
||||||
// The contact wasn't found in the system (most likely some dead account)
|
// The contact wasn't found in the system (most likely some dead account)
|
||||||
// We ensure that we only store a single entry by overwriting the previous name
|
// We ensure that we only store a single entry by overwriting the previous name
|
||||||
Logger::info('Contact not found, updating tag', ['url' => $url, 'name' => $name]);
|
Logger::info('Contact not found, updating tag', ['url' => $url, 'name' => $name]);
|
||||||
|
if (!DBA::exists('tag', ['name' => substr($name, 0, 96), 'url' => $url])) {
|
||||||
DBA::update('tag', ['name' => substr($name, 0, 96)], ['url' => $url]);
|
DBA::update('tag', ['name' => substr($name, 0, 96)], ['url' => $url]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($cid)) {
|
if (empty($cid)) {
|
||||||
if (($type != self::HASHTAG) && !empty($url) && ($url != $name)) {
|
if (($type != self::HASHTAG) && !empty($url) && ($url != $name)) {
|
||||||
|
|
Loading…
Reference in a new issue