Cacti / plugin_flowview

FlowView Plugin for Cacti
GNU General Public License v2.0
18 stars 10 forks source link

flowview_dns_cache using wrong call to DB #151

Closed arno-st closed 3 months ago

arno-st commented 3 months ago

Latest dev repo.


28/06/2024  15:14:50 - CMDPHP SQL Backtrace:   (/plugins/flowview/flowview_devices.php[108]:show_devices(),  /plugins/flowview/flowview_devices.php[676]:flowview_db_fetch_assoc(),  /plugins/flowview/database.php[153]:db_fetch_assoc(),  /lib/database.php[707]:db_fetch_assoc_prepared(),  /lib/database.php[727]:db_execute_prepared())
--
28/06/2024 15:14:50 - CMDPHP ERROR: A DB Row Failed!, Error: Unknown column 'version' in 'field list'
 ```

You call db_execute instead of flowview_db_execute

and check the source, I saw some other wrong call:
68:                             db_execute('DELETE FROM plugin_flowview_dnscache WHERE ' . array_to_sql_or($selected_items, 'id'));
87:                     $dns_list .= '<li>' . html_escape(db_fetch_cell_prepared('SELECT CONCAT(host, "(", ip, ")") AS name FROM plugin_flowview_dnscache WHERE id = ?', array($matches[1]))) . '</li>';
198:                                                            db_fetch_assoc('SELECT DISTINCT source
296:    $total_rows = db_fetch_cell("SELECT COUNT(*)
303:    $dns_cache = db_fetch_assoc("SELECT *
TheWitness commented 3 months ago

Yea, sorry about that. I should likely setup a foreign database.

TheWitness commented 3 months ago

This should be resolved now. Thanks for keeping me honest.