From e77a806f65a2c06bb5c4d5fe6ee717d7abfc7c31 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 8 Sep 2013 21:40:48 +0100 Subject: [PATCH] bug fix: add order_by after nodes name build --- Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm index d683eb59..4aa26527 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm @@ -65,9 +65,9 @@ ajax '/ajax/content/device/ports' => require_login sub { # what kind of nodes are we interested in? my $nodes_name = (param('n_archived') ? 'nodes' : 'active_nodes'); + $nodes_name .= '_with_age' if param('c_nodes') and param('n_age'); $set = $set->search_rs({}, { order_by => ["${nodes_name}.mac", "ips.ip"] }) if param('c_nodes'); - $nodes_name .= '_with_age' if param('c_nodes') and param('n_age'); # retrieve active/all connected nodes, if asked for $set = $set->search_rs({}, { prefetch => [{$nodes_name => 'ips'}] })