From 782084a8fa102eb5f626b4e7f988a2592f56ea77 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 29 Jan 2013 21:31:49 +0000 Subject: [PATCH] Device Port filter by vlan includes both tagging and untagged --- Netdisco/Changes | 4 ++++ Netdisco/lib/App/Netdisco/Web/Device.pm | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index 756c07f3..e52960c4 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -1,5 +1,9 @@ 2.004001 - 2013-01-29 + [ENHANCEMENTS] + + * Device Port filter by vlan includes both tagging and untagged (closes #37) + [BUG FIXES] * No longer prompt for demo/demo credentials (closes #38) (J. Binks) diff --git a/Netdisco/lib/App/Netdisco/Web/Device.pm b/Netdisco/lib/App/Netdisco/Web/Device.pm index 2410e3e3..05c9843e 100644 --- a/Netdisco/lib/App/Netdisco/Web/Device.pm +++ b/Netdisco/lib/App/Netdisco/Web/Device.pm @@ -197,7 +197,12 @@ ajax '/ajax/content/device/ports' => sub { my $q = param('f'); if ($q) { if ($q =~ m/^\d+$/) { - $set = $set->search({'me.vlan' => $q}); + $set = $set->search({ + -or => { + 'me.vlan' => $q, + 'port_vlans_tagged.vlan' => $q, + }, + }, { join => 'port_vlans_tagged' }); return unless $set->count; } else {