Cacti / plugin_reportit

ReportIt Plugin for Cacti
GNU General Public License v2.0
7 stars 8 forks source link

Report-based filters should be cleared when switching reports #69

Closed SergejLT closed 5 years ago

SergejLT commented 5 years ago

cacti v1.1.38, latest reportit GIT

sorting report by any column should be cleared when going back to the main report page and selecting diffrent report with diffrent report template.

getting no data ->

rep1

and this in log ->

2018/10/10 10:26:50 - CMDPHP SQL Backtrace: (/plugins/reportit/view.php: 47 show_report)(/plugins/reportit/view.php: 462 get_prepared_report_data)(/plugins/reportit/lib/funct_shared.php: 120 db_fetch_assoc)(/lib/database.php: 361 db_fetch_assoc_prepared)(/lib/database.php: 402 cacti_debug_backtrace)
--
2018/10/10 10:26:50 - DBCALL ERROR: SQL Assoc Failed!, Error: Unknown column 'spanned__11' in 'order clause'
2018/10/10 10:26:50 - DBCALL ERROR: SQL Assoc Failed!, Error:1054, SQL:'SELECT a.*, b.*, c.name_cache FROM plugin_reportit_results_2 AS a INNER JOIN plugin_reportit_data_items AS b ON (a.id = b.id AND b.report_id = 2) INNER JOIN data_template_data AS c ON c.local_data_id = a.id ORDER BY `spanned__11` DESC LIMIT 0,100'

if I press "Clear" in report then data ir shown correctly and NO errors in log.

looks like it remembers previous sorting option from other viewed report and applies to all reports.

netniV commented 5 years ago

Sounds like a plan. Could you do that in a PR? I won't be able to get to it for a few days.

netniV commented 5 years ago

This has now been committed to the development code.