Merge pull request #11474 from annando/issue-11440

Issue 11440: Hashtags are now generated again
This commit is contained in:
Tobias Diekershoff 2022-05-07 09:31:13 +02:00 committed by GitHub
commit 166f38ef3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,13 +224,16 @@ class Tag
{
$fields = ['name' => substr($name, 0, 96), 'url' => $url];
if (!empty($type)) {
$fields['type'] = $type;
$tag = DBA::selectFirst('tag', ['id', 'type'], $fields);
if (DBA::isResult($tag)) {
if (empty($tag['type']) && !empty($type)) {
DBA::update('tag', ['type' => $type], $fields);
}
return $tag['id'];
}
$tag = DBA::selectFirst('tag', ['id'], $fields);
if (DBA::isResult($tag)) {
return $tag['id'];
if (!empty($type)) {
$fields['type'] = $type;
}
DBA::insert('tag', $fields, Database::INSERT_IGNORE);