Skip to content

Commit 6117f48

Browse files
committed
bugfix: no sql error when adding ticket via ebok and there is no default category set for userpanel
1 parent b4efce5 commit 6117f48

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/LMSManagers/LMSHelpdeskManager.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -1255,8 +1255,10 @@ public function TicketAdd($ticket, $files = null)
12551255

12561256
if (!empty($ticket['categories'])) {
12571257
foreach (array_keys($ticket['categories']) as $catid) {
1258-
$this->db->Execute('INSERT INTO rtticketcategories (ticketid, categoryid)
1259-
VALUES (?, ?)', array($id, $catid));
1258+
if (!empty($catid)) {
1259+
$this->db->Execute('INSERT INTO rtticketcategories (ticketid, categoryid)
1260+
VALUES (?, ?)', array($id, $catid));
1261+
}
12601262
}
12611263
}
12621264

0 commit comments

Comments
 (0)