Merge pull request #2917 from int2001/fix_map_pagination

This commit is contained in:
Joerg (DJ7NT)
2026-02-06 17:02:24 +01:00
committed by GitHub

View File

@@ -2185,9 +2185,6 @@ class Logbook_model extends CI_Model {
$binding[] = $band;
}
}
if ($map == true) {
$sql .= " AND ( qsos.`col_gridsquare` != '' OR qsos.`col_vucc_grids` != '')";
}
$sql .= " AND qsos.`station_id` IN ?
ORDER BY qsos.`COL_TIME_ON` DESC, qsos.`COL_PRIMARY_KEY` DESC";
$binding[] = $logbooks_locations_array;
@@ -2213,6 +2210,16 @@ class Logbook_model extends CI_Model {
}
unset($row);
// Apply map filter in PHP to ensure pagination works correctly
// When $map is true, filter out QSOs without gridsquare data AFTER applying LIMIT/OFFSET
if ($map == true) {
$results = array_filter($results, function($row) {
return !empty($row->COL_GRIDSQUARE) || !empty($row->COL_VUCC_GRIDS);
});
// Re-index array after filtering
$results = array_values($results);
}
// Return a query-like object with result() method for compatibility
return new class($results) {
private $data;