From 6117f48eaff4dc3fe2eb4587968870a7d0c99b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20K=C5=82opotek=20-=20INTERDUO?= Date: Mon, 3 Feb 2025 10:30:54 +0100 Subject: [PATCH] bugfix: no sql error when adding ticket via ebok and there is no default category set for userpanel --- lib/LMSManagers/LMSHelpdeskManager.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/LMSManagers/LMSHelpdeskManager.php b/lib/LMSManagers/LMSHelpdeskManager.php index 9dff834e31..d9aa9e6375 100644 --- a/lib/LMSManagers/LMSHelpdeskManager.php +++ b/lib/LMSManagers/LMSHelpdeskManager.php @@ -1255,8 +1255,10 @@ public function TicketAdd($ticket, $files = null) if (!empty($ticket['categories'])) { foreach (array_keys($ticket['categories']) as $catid) { - $this->db->Execute('INSERT INTO rtticketcategories (ticketid, categoryid) - VALUES (?, ?)', array($id, $catid)); + if (!empty($catid)) { + $this->db->Execute('INSERT INTO rtticketcategories (ticketid, categoryid) + VALUES (?, ?)', array($id, $catid)); + } } }