From 67aebae2d3aed740028bb31ad541ff5c24ce0732 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 25 Jan 2015 15:18:35 +0000 Subject: [PATCH] [#195] Fix CGI params parsing rows limit when "All" selected --- Netdisco/Changes | 1 + Netdisco/lib/App/Netdisco/DB/ResultSet.pm | 2 +- Netdisco/lib/App/Netdisco/Web/Plugin/Report/DevicePoeStatus.pm | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index c7ce0d9c..ccec85b5 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -16,6 +16,7 @@ * [#174] LDAP users should not be able to change password * [#182] SSID and PoE showing in wrong Device Port columns * [#181] AP Client Count report was broken + * [#195] Fix CGI params parsing rows limit when "All" selected 2.030000 - 2015-01-08 diff --git a/Netdisco/lib/App/Netdisco/DB/ResultSet.pm b/Netdisco/lib/App/Netdisco/DB/ResultSet.pm index 6faa6e3d..7fbf8c56 100644 --- a/Netdisco/lib/App/Netdisco/DB/ResultSet.pm +++ b/Netdisco/lib/App/Netdisco/DB/ResultSet.pm @@ -171,7 +171,7 @@ sub _with_datatables_paging { $attrs->{'offset'} = $offset; $rs = $rs->search( {}, $attrs ); - $rs = $rs->limit($limit); + $rs = $rs->limit($limit) if ($limit and $limit > 0); return $rs; } diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DevicePoeStatus.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DevicePoeStatus.pm index 43ad50df..50ba0e1d 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DevicePoeStatus.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DevicePoeStatus.pm @@ -22,11 +22,8 @@ get '/ajax/content/report/devicepoestatus/data' => require_role admin => sub { my $rs = schema('netdisco')->resultset('Virtual::DevicePoeStatus'); my $exp_params = expand_hash( scalar params ); - my $recordsTotal = $rs->count; - my @data = $rs->get_datatables_data($exp_params)->hri->all; - my $recordsFiltered = $rs->get_datatables_filtered_count($exp_params); content_type 'application/json';