From b750276dad83794b53c70619acce426101c5b2c4 Mon Sep 17 00:00:00 2001 From: teabreakninja Date: Mon, 18 Jan 2016 12:31:41 +0000 Subject: [PATCH 1/2] Update logbook_model.php Needed to check for existence of 'freq' in log. --- application/models/logbook_model.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/application/models/logbook_model.php b/application/models/logbook_model.php index 3f739ff4..6de8aaa7 100644 --- a/application/models/logbook_model.php +++ b/application/models/logbook_model.php @@ -695,8 +695,13 @@ class Logbook_model extends CI_Model { } // Store Freq - $cleanfreq = preg_replace('#\W#', '', $record['freq']); - $freqlng = strlen($cleanfreq); + // Check if 'freq' is defined in the import? + if (isset($record['freq'])){ + $cleanfreq = preg_replace('#\W#', '', $record['freq']); + $freqlng = strlen($cleanfreq); + }else{ + $freqlng = 0; + } if(isset($record['freq']) && $freqlng < 7 ) { $cleansedstring = preg_replace('#\W#', '', $record['freq']); $freq = $cleansedstring."000"; From c824c07f936e8cfd95e4dbd4e60741941dd25335 Mon Sep 17 00:00:00 2001 From: teabreakninja Date: Mon, 18 Jan 2016 12:38:00 +0000 Subject: [PATCH 2/2] Update qso.php Make array declarations php v5.3 friendly! --- application/controllers/qso.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/application/controllers/qso.php b/application/controllers/qso.php index a0c8ab25..3d13ef41 100644 --- a/application/controllers/qso.php +++ b/application/controllers/qso.php @@ -47,14 +47,17 @@ class QSO extends CI_Controller { // This solves the problem of CI dumping out the session // cookie each time set_userdata is called. // For more info, see http://bizhole.com/codeigniter-nginx-error-502-bad-gateway/ - $qso_data = [ + // $qso_data = [ + // 18-Jan-2016 - make php v5.3 friendly! + $sqo_data = array( 'band' => $this->input->post('band'), 'freq' => $this->input->post('freq'), 'mode' => $this->input->post('mode'), 'sat_name' => $this->input->post('sat_name'), 'sat_mode' => $this->input->post('sat_mode'), 'radio' => $this->input->post('radio') - ]; + ); + // ]; $this->session->set_userdata($qso_data); @@ -111,14 +114,17 @@ class QSO extends CI_Controller { $this->logbook_model->create_qso(); // Store Basic QSO Info for reuse - $qso_data = [ + //$qso_data = [ + // 18-Jan-2016 - make php v5.3 friendly! + $qso_data = array( 'band' => $this->input->post('band'), 'freq' => $this->input->post('freq'), 'mode' => $this->input->post('mode'), 'sat_name' => $this->input->post('sat_name'), 'sat_mode' => $this->input->post('sat_mode'), 'radio' => $this->input->post('radio') - ]; + ); + //]; $this->session->set_userdata($qso_data);