From 4024616e53c127dbd44290c1a4a3ca93ec91f03d Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Thu, 10 Aug 2023 09:07:24 +0200 Subject: [PATCH] [Logbook Advanced] Fixed callbook lookup --- application/controllers/Logbookadvanced.php | 2 +- src/QSLManager/QSO.php | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 8b7f0cf8..d041ba26 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -140,7 +140,7 @@ class Logbookadvanced extends CI_Controller { $callbook = $this->logbook_model->loadCallBook($qso['COL_CALL'], $this->config->item('use_fullname')); - if ($callbook['callsign'] !== "") { + if ($callbook['callsign'] ?? "" !== "") { $this->logbookadvanced_model->updateQsoWithCallbookInfo($qsoID, $qso, $callbook); $qso['COL_NAME'] = trim($callbook['name']); if (isset($callbook['qslmgr'])) { diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 1db43ced..7f9539a3 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -117,7 +117,6 @@ class QSO 'COL_STATE', 'COL_COUNTRY', 'COL_IOTA', - 'name' ]; @@ -196,16 +195,16 @@ class QSO $this->cqzone = ($data['COL_CQZ'] === null) ? '' : ''.$data['COL_CQZ'].''; $this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE']; - $this->dxcc = ($data['name'] === null) ? '- NONE -' : ''.ucwords(strtolower($data['name']), "- (/").''; + $this->dxcc = ($data['name'] ?? null === null) ? '- NONE -' : ''.ucwords(strtolower($data['name']), "- (/").''; $this->iota = ($data['COL_IOTA'] === null) ? '' : $this->getIotaLink($data['COL_IOTA']); if (array_key_exists('end', $data)) { $this->end = ($data['end'] === null) ? null : DateTime::createFromFormat("Y-m-d", $data['end'], new DateTimeZone('UTC')); } else { $this->end = null; } - $this->callsign = ($data['callsign'] === null) ? '' :$data['callsign']; - $this->lastupload = ($data['lastupload'] === null) ? '' : date($custom_date_format . " H:i", strtotime($data['lastupload'])); - $this->lotw_hint = $this->getLotwHint($data['lastupload']); + $this->callsign = ($data['callsign'] ?? null === null) ? '' :$data['callsign']; + $this->lastupload = ($data['lastupload'] ?? null === null) ? '' : date($custom_date_format . " H:i", strtotime($data['lastupload'] ?? null)); + $this->lotw_hint = $this->getLotwHint($data['lastupload'] ?? null); } /** @@ -323,7 +322,7 @@ class QSO } } $qslstring .= '">▼'; - if ($data['qslcount'] != null) { + if ($data['qslcount'] ?? null != null) { $qslstring .= ' '; } return $qslstring;