From 5b5ad00f71cc455e0266df088c3a97589eaac02c Mon Sep 17 00:00:00 2001 From: nick n <39005454+inphobia@users.noreply.github.com> Date: Wed, 27 Feb 2019 05:11:11 +0100 Subject: [PATCH] always prefer device entries over node_ip entries first part of the fix for #514 select distinct needs to be provided with an explicit order to return consistent results. ip & active suffices for nodes, but if it's a device with an entry in node_ip we get random results. so also order on boolean node to prefer device entries in that case. (at the time of writing however none of my devices return a mac address, which might be another bug) --- lib/App/Netdisco/Web/Plugin/Report/IpInventory.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/App/Netdisco/Web/Plugin/Report/IpInventory.pm b/lib/App/Netdisco/Web/Plugin/Report/IpInventory.pm index 315db783..437462ae 100644 --- a/lib/App/Netdisco/Web/Plugin/Report/IpInventory.pm +++ b/lib/App/Netdisco/Web/Plugin/Report/IpInventory.pm @@ -110,7 +110,7 @@ get '/ajax/content/report/ipinventory' => require_login sub { 'ip', 'mac', 'dns', 'time_last', 'time_first', 'active', 'node', 'age' ], - order_by => [{-asc => 'ip'}, {-desc => 'active'}], + order_by => [{-asc => 'ip'}, {-desc => 'active'}, {-asc => 'node'}], } )->as_query;