diff --git a/modals/admin_vendor_template_add_modal.php b/modals/admin_vendor_template_add_modal.php index 4e5f5dcb..e8a2ba85 100644 --- a/modals/admin_vendor_template_add_modal.php +++ b/modals/admin_vendor_template_add_modal.php @@ -75,20 +75,23 @@
- +
-
+
- + +
-
- +
+
+ +
diff --git a/post/user/ticket.php b/post/user/ticket.php index b833774f..99f16ebd 100644 --- a/post/user/ticket.php +++ b/post/user/ticket.php @@ -203,6 +203,10 @@ if (isset($_POST['edit_ticket'])) { $additional_asset_id = intval($additional_asset); mysqli_query($mysqli, "INSERT INTO ticket_assets SET ticket_id = $ticket_id, asset_id = $additional_asset_id"); } + } else { + // If no additional assets are provided, delete them all + // This handles cases where the assets input might be cleared or not set at all. + mysqli_query($mysqli, "DELETE FROM ticket_assets WHERE ticket_id = $ticket_id"); } // Get contact/ticket details after update for logging / email purposes