From: Michael Date: Fri, 6 May 2022 17:03:51 +0000 (+0000) Subject: Issue 11440: Hashtags are now generated again X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=67c3a20c4f709527dada25ed66690c564ddf98e5;p=friendica.git Issue 11440: Hashtags are now generated again --- diff --git a/src/Model/Tag.php b/src/Model/Tag.php index 0ea19f55d9..b1c9822191 100644 --- a/src/Model/Tag.php +++ b/src/Model/Tag.php @@ -224,15 +224,18 @@ class Tag { $fields = ['name' => substr($name, 0, 96), 'url' => $url]; - if (!empty($type)) { - $fields['type'] = $type; - } - - $tag = DBA::selectFirst('tag', ['id'], $fields); + $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']; } + if (!empty($type)) { + $fields['type'] = $type; + } + DBA::insert('tag', $fields, Database::INSERT_IGNORE); $tid = DBA::lastInsertId(); if (!empty($tid)) {