diff --git a/Changes b/Changes index f7158a18..96406a38 100644 --- a/Changes +++ b/Changes @@ -15,6 +15,7 @@ [BUG FIXES] * Specific search from titlebar uses default sidebar settings + * Fix Device Ports search for VLAN prefer with non-numeric value 2.036011 - 2017-10-09 diff --git a/lib/App/Netdisco/Web/Plugin/Device/Ports.pm b/lib/App/Netdisco/Web/Plugin/Device/Ports.pm index c791979a..0e9f66b8 100644 --- a/lib/App/Netdisco/Web/Plugin/Device/Ports.pm +++ b/lib/App/Netdisco/Web/Plugin/Device/Ports.pm @@ -23,7 +23,9 @@ get '/ajax/content/device/ports' => require_login sub { # refine by ports if requested my $f = param('f'); if ($f) { - if (($prefer eq 'vlan') or not $prefer and $f =~ m/^\d+$/) { + if (($prefer eq 'vlan') or (not $prefer and $f =~ m/^\d+$/)) { + return unless $f =~ m/^\d+$/; + if (param('invert')) { $set = $set->search({ 'me.vlan' => { '!=' => $f },