From f0154a9db843350c7f74cd047f6cc96d93151aa8 Mon Sep 17 00:00:00 2001 From: Antonio Fernandez Date: Sat, 11 Apr 2026 14:19:18 -0400 Subject: [PATCH] Bug Fix: on $action_name = 'both' there was no comma (#466) No command when action_name was set to 'both' causing the SQL statement to be invalid --- debian/resources/maintenance/call_recordings.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/resources/maintenance/call_recordings.php b/debian/resources/maintenance/call_recordings.php index b5a1153..8558bae 100644 --- a/debian/resources/maintenance/call_recordings.php +++ b/debian/resources/maintenance/call_recordings.php @@ -166,13 +166,14 @@ crontab -e } //update the database to the new directory - $sql = "update v_xml_cdr set \n"; + $set_clauses = []; if ($action_name == 'move' || $action_name == 'both') { - $sql .= "record_path = '".$new_path."' \n"; + $set_clauses[] = "record_path = '".$new_path."'"; } if ($action_name == 'convert' || $action_name == 'both') { - $sql .= "record_name = '".$path_parts['filename'].".mp3'\n"; + $set_clauses[] = "record_name = '".$path_parts['filename'].".mp3'"; } + $sql = "update v_xml_cdr set " . implode(", ", $set_clauses) . " \n"; $sql .= "where xml_cdr_uuid = '".$row['xml_cdr_uuid']."';\n"; if ($debug) { echo $sql."\n"; } $database->execute($sql);