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
This commit is contained in:
Antonio Fernandez
2026-04-11 14:19:18 -04:00
committed by GitHub
parent c97579ab69
commit f0154a9db8

View File

@@ -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);