From 07a4682101fc7cd8b17bfac8d4e344823ab38c05 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Fri, 5 Jul 2024 21:38:38 +0200 Subject: [PATCH] when updating the session fill the session data only with existing options. --- application/models/User_model.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/application/models/User_model.php b/application/models/User_model.php index 8e74048f6..7651c89d9 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -408,7 +408,7 @@ class User_Model extends CI_Model { if ($u == null) { $u = $this->get_by_id($id); } - + $userdata = array( 'user_id' => $u->row()->user_id, 'user_name' => $u->row()->user_name, @@ -450,7 +450,14 @@ class User_Model extends CI_Model { 'isWinkeyEnabled' => $u->row()->winkey, 'hasQrzKey' => $this->hasQrzKey($u->row()->user_id) ); - + + foreach (array_keys($this->frequency->defaultFrequencies) as $band) { + $qrg_unit = $this->session->userdata("qrgunit_$band") ?? ($this->user_options_model->get_options('frequency', array('option_name' => 'unit', 'option_key' => $band))->row()->option_value ?? ''); + if ($qrg_unit !== '') { + $userdata['qrgunit_'.$band] = $qrg_unit; + } + } + $this->session->set_userdata($userdata); }