Compare commits
2 Commits
b385e177ec
...
f7321863e6
| Author | SHA1 | Date | |
|---|---|---|---|
| f7321863e6 | |||
| d21691a548 |
+16
-9
@@ -747,16 +747,23 @@ class TicketModel {
|
|||||||
];
|
];
|
||||||
|
|
||||||
foreach ($children as $sql) {
|
foreach ($children as $sql) {
|
||||||
$stmt = $this->conn->prepare($sql);
|
try {
|
||||||
if (!$stmt) continue;
|
$stmt = $this->conn->prepare($sql);
|
||||||
// ticket_dependencies uses two placeholders
|
if (!$stmt) continue;
|
||||||
if (strpos($sql, 'depends_on_id') !== false) {
|
// ticket_dependencies uses two placeholders
|
||||||
$stmt->bind_param('ss', $ticketId, $ticketId);
|
if (strpos($sql, 'depends_on_id') !== false) {
|
||||||
} else {
|
$stmt->bind_param('ss', $ticketId, $ticketId);
|
||||||
$stmt->bind_param('s', $ticketId);
|
} else {
|
||||||
|
$stmt->bind_param('s', $ticketId);
|
||||||
|
}
|
||||||
|
$stmt->execute();
|
||||||
|
$stmt->close();
|
||||||
|
} catch (mysqli_sql_exception $e) {
|
||||||
|
// Skip optional tables that may not exist in all deployments
|
||||||
|
if (strpos($e->getMessage(), "doesn't exist") === false) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$stmt->execute();
|
|
||||||
$stmt->close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt = $this->conn->prepare("DELETE FROM tickets WHERE ticket_id = ?");
|
$stmt = $this->conn->prepare("DELETE FROM tickets WHERE ticket_id = ?");
|
||||||
|
|||||||
Reference in New Issue
Block a user