Skip to content

Commit cc1b92c

Browse files
committed
Fix DXCC ID assignment in logbook model
Corrects the logic for assigning DXCC ID when the country is set and dxcc_id is 0 by fetching the DXCC ID from the callsign lookup. This ensures the correct DXCC ID is used in these cases.
1 parent 58d7eee commit cc1b92c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

application/models/Logbook_model.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ function create_qso()
127127
} else {
128128
// if $country isn't empty and dxcc_id is 0 use the DXCC ID from the callsign lookup
129129
if (!empty($country) && $this->input->post('dxcc_id') == "0") {
130-
$dxcc_id = $dxcc_id;
130+
$dxcc = $this->check_dxcc_table(strtoupper(trim($callsign)), $datetime);
131+
$dxcc_id = !empty($dxcc[0]) ? $dxcc[0] : 0;
131132
} else {
132133
$dxcc_id = $this->input->post('dxcc_id');
133134
}

0 commit comments

Comments
 (0)