mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
filter out NULL lat/lng values from Geographical Map display queries (#12985)
* filter out null lat/long values from map display queries * removed space * and the 2nd one Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
This commit is contained in:
@@ -84,6 +84,7 @@ var greenMarker = L.AwesomeMarkers.icon({
|
||||
$sql = "SELECT DISTINCT(`device_id`),`location`,`sysName`,`hostname`,`os`,`status`,`lat`,`lng` FROM `devices`
|
||||
LEFT JOIN `locations` ON `devices`.`location_id`=`locations`.`id`
|
||||
WHERE `disabled`=0 AND `ignore`=0 AND ((`lat` != '' AND `lng` != '') OR (`location` REGEXP '\[[0-9\.\, ]+\]'))
|
||||
AND (`lat` IS NOT NULL AND `lng` IS NOT NULL)
|
||||
AND `status` IN " . dbGenPlaceholders(count($show_status)) .
|
||||
' ORDER BY `status` ASC, `hostname`';
|
||||
$param = $show_status;
|
||||
@@ -95,6 +96,7 @@ var greenMarker = L.AwesomeMarkers.icon({
|
||||
FROM `devices`
|
||||
LEFT JOIN `locations` ON `devices`.location_id=`locations`.`id`
|
||||
WHERE `disabled`=0 AND `ignore`=0 AND ((`lat` != '' AND `lng` != '') OR (`location` REGEXP '\[[0-9\.\, ]+\]'))
|
||||
AND (`lat` IS NOT NULL AND `lng` IS NOT NULL)
|
||||
AND `devices`.`device_id` IN " . dbGenPlaceholders(count($device_ids)) .
|
||||
' AND `status` IN ' . dbGenPlaceholders(count($show_status)) .
|
||||
' ORDER BY `status` ASC, `hostname`';
|
||||
|
||||
Reference in New Issue
Block a user