From 481c8929a90e920e3e0316b907bcc9b5900fe31b Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Sun, 8 Aug 2021 09:56:04 +0200 Subject: [PATCH] Correct handling of device vendor settings Prefix was incorrect following removal of _column names --- sccpManTraits/ajaxHelper.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sccpManTraits/ajaxHelper.php b/sccpManTraits/ajaxHelper.php index 4c37482..e1d1bb6 100644 --- a/sccpManTraits/ajaxHelper.php +++ b/sccpManTraits/ajaxHelper.php @@ -691,7 +691,7 @@ trait ajaxHelper { function saveSccpDevice($get_settings, $validateonly = false) { $hdr_prefix = 'sccp_hw_'; $hdr_arprefix = 'sccp_hw-ar_'; - $hdr_vendPrefix = 'sccp_hw_vendorconfig'; + $hdr_vendPrefix = 'vendorconfig_'; $save_buttons = array(); $save_settings = array(); @@ -711,8 +711,9 @@ trait ajaxHelper { $hw_prefix = 'VG'; } } - foreach ($db_field as $data) { - $key = (string) $data['Field']; + dbug($get_settings); + dbug($db_field); + foreach ($db_field as $key) { $value = ""; switch ($key) { case 'name': @@ -792,15 +793,13 @@ trait ajaxHelper { // Now only have normal prefix if (!empty($get_settings["{$hdr_prefix}{$key}"])) { $value = $get_settings["{$hdr_prefix}{$key}"]; - } else if (!empty($get_settings["sccp_hw{$key}"])) { - //have an underscore db field - $value = $get_settings["sccp_hw{$key}"]; } } if (!empty($value)) { $save_settings[$key] = $value; } } + dbug($save_settings); // Save this device. $this->dbinterface->write('sccpdevice', $save_settings, 'replace'); // Retrieve the phone buttons from $_REQUEST ($get_settings) and write back to