Fix incompatibility with new Describe table

This commit is contained in:
steve-lad 2021-08-09 09:23:00 +02:00
parent 662e2a4aa3
commit 91d6ad2f48
2 changed files with 2 additions and 3 deletions

View file

@ -121,7 +121,7 @@ class dbinterface
$stmts = $this->db->prepare('DESCRIBE sccpuser'); $stmts = $this->db->prepare('DESCRIBE sccpuser');
break; break;
case 'get_columns_sccpline': case 'get_columns_sccpline':
$stmts = $this->db->prepare('DESCRIBE sccpline'); $stmtU = $this->db->prepare('DESCRIBE sccpline');
break; break;
case 'get_sccpdevice_byid': case 'get_sccpdevice_byid':
$stmt = $this->db->prepare('SELECT t1.*, types.dns, types.buttons, types.loadimage, types.nametemplate as nametemplate, $stmt = $this->db->prepare('SELECT t1.*, types.dns, types.buttons, types.loadimage, types.nametemplate as nametemplate,

View file

@ -77,8 +77,7 @@ trait helperfunctions {
return $this->sccpvalues; return $this->sccpvalues;
} }
$sccpTableDesc = $this->dbinterface->getSccpDeviceTableData("get_columns_{$table}"); $sccpTableDesc = $this->dbinterface->getSccpDeviceTableData("get_columns_{$table}");
foreach ($sccpTableDesc as $data) { foreach ($sccpTableDesc as $key => $data) {
$key = (string) $data['Field'];
// function has 2 roles: return actual table keys (trim_underscore = false) // function has 2 roles: return actual table keys (trim_underscore = false)
// return sanitised keys to add defaults (trim_underscore = true) // return sanitised keys to add defaults (trim_underscore = true)
if ($trim_underscore) { if ($trim_underscore) {