From b0e8c7413d1044f117b4510786f2df9646cfbcb8 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 11 Jan 2014 09:56:36 +0000 Subject: [PATCH] always get vlans if column is enabled --- Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm index 4e7533c8..b41cd28a 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Ports.pm @@ -111,13 +111,9 @@ get '/ajax/content/device/ports' => require_login sub { # make sure query asks for formatted timestamps when needed $set = $set->with_times if param('c_lastchange'); - # get number of vlans on the port to control whether to list them or not - $set = $set->with_vlan_count if param('c_vmember'); - - # run single collapsed query for all relations, but only if we're not - # also fetching archived data (tests show it's better this way) - $set = $set->search_rs({}, { prefetch => 'all_port_vlans' }) - if param('c_vmember') and not (param('c_nodes') and param('n_archived')); + # get vlans on the port + $set = $set->search_rs({}, { prefetch => 'all_port_vlans' })->with_vlan_count + if param('c_vmember'); # what kind of nodes are we interested in? my $nodes_name = (param('n_archived') ? 'nodes' : 'active_nodes');