From 3fa1ef2b704fa4f7954fc0334ed35e6224aa9c47 Mon Sep 17 00:00:00 2001 From: Murtaza Sultani Date: Mon, 17 Nov 2025 13:43:50 +0100 Subject: =?UTF-8?q?Resolve=20"Forum:=20Beim=20Bearbeiten=20einer=20Diskuss?= =?UTF-8?q?ion=20werden=20ausgew=C3=A4hlte=20Tags=20doppelt=20gespeichert"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #6057 Merge request studip/studip!4612 --- app/controllers/course/forum/discussions.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/course/forum/discussions.php b/app/controllers/course/forum/discussions.php index 4a71519..b57208d 100644 --- a/app/controllers/course/forum/discussions.php +++ b/app/controllers/course/forum/discussions.php @@ -200,18 +200,17 @@ class Course_Forum_DiscussionsController extends Forum\BaseController } $tags = json_decode(Request::get('tags'), true); - foreach ($tags as $tag) { - if (empty($tag['tag_id'])) { + if (empty($tag['id'])) { $newTag = Tag::create([ 'name' => $tag['name'], ]); - $tag['tag_id'] = $newTag->id; + $tag['id'] = $newTag->id; } TagRelation::create([ - 'tag_id' => $tag['tag_id'], + 'tag_id' => $tag['id'], 'range_id' => $discussion->discussion_id, 'range_type' => 'forum' ]); -- cgit v1.0