diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/ModuleInventory.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/ModuleInventory.pm index ec449496..5755781a 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/ModuleInventory.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/ModuleInventory.pm @@ -109,7 +109,7 @@ get '/ajax/content/report/moduleinventory' => require_login sub { else { header( 'Content-Type' => 'text/comma-separated-values' ); template 'ajax/report/moduleinventory_csv.tt', - { results => $rs, opt => $has_opt }, + { results => \@results, opt => $has_opt }, { layout => undef }; } }; diff --git a/Netdisco/share/views/ajax/report/moduleinventory_csv.tt b/Netdisco/share/views/ajax/report/moduleinventory_csv.tt index 6c2c1c13..3c4e7687 100644 --- a/Netdisco/share/views/ajax/report/moduleinventory_csv.tt +++ b/Netdisco/share/views/ajax/report/moduleinventory_csv.tt @@ -2,9 +2,9 @@ [% IF opt %] [% CSV.dump(['Device' 'Description' 'Name' 'Class' 'Type' 'Model' 'Serial' 'HW Version' 'SW Version' 'FW Version']) %] - [% WHILE (row = results.next) %] + [% FOREACH row IN results %] [% mylist = [] %] - [% device = row.device.dns || row.device.name || row.device.ip %] + [% device = row.device.dns || row.device.name || row.ip %] [% FOREACH col IN [ device row.description row.name row.class.ucfirst row.type row.model row.serial row.hw_ver row.sw_ver row.fw_ver ] %] [% mylist.push(col) %] [% END %] @@ -14,7 +14,7 @@ [% ELSE %] [% CSV.dump(['Class' 'Count']) %] - [% WHILE (row = results.next) %] + [% FOREACH row IN results %] [% mylist = [] %] [% FOREACH col IN [ row.class.ucfirst row.count ] %] [% mylist.push(col) %]