Include other unique key column in condition in Model\Tag:store

- Address https://github.com/friendica/friendica/issues/12486#issuecomment-1372640002
This commit is contained in:
Hypolite Petovan 2023-01-09 09:52:04 -05:00
parent 69a9c2c618
commit 670b518875

View File

@ -119,7 +119,7 @@ class Tag
$tag = DBA::selectFirst('tag', ['name', 'type'], ['url' => $url]);
if (!empty($tag)) {
if ($tag['name'] != substr($name, 0, 96)) {
DBA::update('tag', ['name' => substr($name, 0, 96)], ['url' => $url]);
DBA::update('tag', ['name' => substr($name, 0, 96)], ['url' => $url, 'type' => $tag['type']]);
}
if (!empty($target) && ($tag['type'] != $target)) {
DBA::update('tag', ['type' => $target], ['url' => $url]);