From 67c3a20c4f709527dada25ed66690c564ddf98e5 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 6 May 2022 17:03:51 +0000 Subject: [PATCH] Issue 11440: Hashtags are now generated again --- src/Model/Tag.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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,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);