Hi all, i am very new to Freepbx, so basically i have encountered an issue while changing the input for device id. The device ID initially only accepts integer right? however i wanted to allow input with characters and dash/underscore as well. I have a function to filter the input, the function is show below:
function isCustom(c){
return new RegExp(/[1]+$/).test(c);
}
the function works fine when i inserted it onto the "new gui_textbox(‘deviceid’,$extdisplay,(“Device ID”),(“skip this for now”), ‘!isCustom()’, $msgInvalidDevID, false)); which only allow the inputs specified.
HOWEVER! the issue starts here which is the admin/config.php file won’t load when the device id contains character or even underscore in it, but if i try to add new device id with ONLY integer, the the admin/config.php will be loaded smoothly.
- I have checked my mysql and the type for ID is varchar(20)
- I have also print_r the $results from the function core_devices_get and i managed to retrieve both the array of data of device id with character and device id with only integer.
- I have also went to check the logs at /var/log/httpd/error_freepbx_log which gave me this error stating “PHP Fatal error: Cannot use object of type DB_Error as array in /var/www/html/admin/modules/core/functions.inc.php on line 8870”
a-zA-Z0-9_- ↩︎