From 8e16f7b42554447d0021c23f813246214aee8da9 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 13 Jul 2025 20:22:15 +0200 Subject: [PATCH] [Advanced Logbook] Fix error if call was not found in the callbook --- application/controllers/Logbookadvanced.php | 17 ++++++++--------- assets/js/sections/logbookadvanced.js | 5 +++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 0d2b313a6..fa9950173 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -196,17 +196,16 @@ class Logbookadvanced extends CI_Controller { $station_profile = $this->stations->profile($active_station_id)->row_array(); $this->logbookadvanced_model->updateQsoWithCallbookInfo($qso['COL_PRIMARY_KEY'], $qso, $callbook, $station_profile['station_gridsquare']); $qso = $this->logbookadvanced_model->getQsosForAdif(json_encode($qsoID), $this->session->userdata('user_id'))->row_array(); + } - $qsoObj = new QSO($qso); // Redirection via Object to clean/convert QSO (get rid of cols) - $cleaned_qso=$qsoObj->toArray(); // And back to Array for the JSON - - $flag = $this->dxccflag->get($qsoObj->getDXCCId()); - if ($flag != null) { - $cleaned_qso['flag'] = ' '.$flag; - } else { - $cleaned_qso['flag'] = ''; - } + $qsoObj = new QSO($qso); // Redirection via Object to clean/convert QSO (get rid of cols) + $cleaned_qso = $qsoObj->toArray(); // And back to Array for the JSON + $flag = $this->dxccflag->get($qsoObj->getDXCCId()); + if ($flag != null) { + $cleaned_qso['flag'] = ' ' . $flag; + } else { + $cleaned_qso['flag'] = ''; } header("Content-Type: application/json"); diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index edccdf5fe..f454538ce 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -426,13 +426,14 @@ function processNextCallbookItem() { }, dataType: 'json', success: function (data) { - if (data != []) { + if (data && data.dx) { updateRow(data); - unselectQsoID(id); } + unselectQsoID(id); setTimeout("processNextCallbookItem()", 50); }, error: function (data) { + unselectQsoID(id); setTimeout("processNextCallbookItem()", 50); }, });