-
Type:
Bug
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FreePBX Framework
-
Labels:None
-
Bug Tracker:Customer Issue
-
Asterisk Version:Asterisk 16.16.1
-
Distro Version:FreePBX 16.0.10.44
-
Distro:Self Install Debian
I would like to add my own music on hold as a WAV file under "Settings" and "Music on hold". After pressing the "Submit" button, the message "An Error occurred trying to submit this document" appears, followed by a modal with the message
{{SQLSTATE [22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `asterisk`.`music`.`random` at row 1 File: /var/www/html/admin/modules/music/Music.class.php: 135 }}
The music table looks like this
{{SHOW FIELDS FROM music;
-----------------------------------------------------+
Field | Type | Null | Key | Default | Extra |
-----------------------------------------------------+
id | int(11) | NO | PRI | NULL | auto_increment |
category | varchar(190) | YES | UNI | NULL | |
type | varchar(100) | YES | NULL | ||
random | tinyint(1) | YES | 0 | ||
application | varchar(255) | YES | NULL | ||
format | varchar(10) | YES | NULL |
-----------------------------------------------------+
6 rows in set (0.004 sec)}}
The PHP file looks like this on line 135{{public function updateCategoryByID($id, $type, $random = false, $application = '', $format = '') {
$sql = "UPDATE music SET type = :type, random = :random, application = :application, format = :format WHERE id = :id";
$sth = $this->db->prepare($sql);
$sth->execute(array(
"type" => $type,
"random" => $random,
"application" => $application,
"format" => $format,
"id" => $id
));
needreload();
}}}
How can I fix this error?
Best regards
Diani