From 91d6ad2f48bf331b61e5f69bc1e5dedb6b6a32a0 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Mon, 9 Aug 2021 09:23:00 +0200 Subject: [PATCH] Fix incompatibility with new Describe table --- sccpManClasses/dbinterface.class.php | 2 +- sccpManTraits/helperFunctions.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sccpManClasses/dbinterface.class.php b/sccpManClasses/dbinterface.class.php index f86b43b..4e3f45d 100644 --- a/sccpManClasses/dbinterface.class.php +++ b/sccpManClasses/dbinterface.class.php @@ -121,7 +121,7 @@ class dbinterface $stmts = $this->db->prepare('DESCRIBE sccpuser'); break; case 'get_columns_sccpline': - $stmts = $this->db->prepare('DESCRIBE sccpline'); + $stmtU = $this->db->prepare('DESCRIBE sccpline'); break; case 'get_sccpdevice_byid': $stmt = $this->db->prepare('SELECT t1.*, types.dns, types.buttons, types.loadimage, types.nametemplate as nametemplate, diff --git a/sccpManTraits/helperFunctions.php b/sccpManTraits/helperFunctions.php index f5cd640..97205d1 100644 --- a/sccpManTraits/helperFunctions.php +++ b/sccpManTraits/helperFunctions.php @@ -77,8 +77,7 @@ trait helperfunctions { return $this->sccpvalues; } $sccpTableDesc = $this->dbinterface->getSccpDeviceTableData("get_columns_{$table}"); - foreach ($sccpTableDesc as $data) { - $key = (string) $data['Field']; + foreach ($sccpTableDesc as $key => $data) { // function has 2 roles: return actual table keys (trim_underscore = false) // return sanitised keys to add defaults (trim_underscore = true) if ($trim_underscore) {