Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* issue: Decode MAC/IP OIDs as hex in the Extreme scanner by correcting a misplaced xform_stripped_oid() argument
* issue: Fix an undefined $ifindex reference (should be $ifIndex) in the Nortel Bay scanner
* issue: Fix a misplaced parenthesis in the running-process stats parser
* issue: Remove a trailing comma before WHERE in the device edit page's SNMP settings UPDATE, which caused an SQL syntax error whenever the SNMP settings were auto-corrected
* issue: Fix "401 Permission Denied" on the Dashboard after upgrading: the Dashboard page was added to the Mactrack Viewer realm without a version bump, so upgraded installs never mapped it to a realm. The upgrade check now also compares the registered realm file lists against the code (`mactrack_realms_are_stale()`) and re-registers them, which carries existing Viewer grants over to the Dashboard. The repair only registers the realms (no schema upgrade) and never grants a newly created realm to the requesting user
* issue: Fix the Graphs tab fatal error "Call to undefined function graph_view_has_untemplated_graphs()" on Cacti 1.2.x releases whose graph preview filter calls a helper defined in graph_view.php; the plugin now supplies a guarded polyfill, which is a no-op where core already defines it
* issue: Make the MacTrack tab script repoint only the MacTrack main tab rather than whichever main tab is selected, so it can never retarget the Console tab at a MacTrack page
Expand Down
2 changes: 1 addition & 1 deletion mactrack_devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ function mactrack_device_edit(): void {
SET device_type_id = ?, scan_type = ?, snmp_version = ?,
snmp_readstring = ?, snmp_port = ?, snmp_timeout = ?, snmp_retries = ?,
max_oids = ?, snmp_username = ?, snmp_password = ?, snmp_auth_protocol = ?,
snmp_priv_passphrase = ?, snmp_priv_protocol = ?, snmp_context = ?,
snmp_priv_passphrase = ?, snmp_priv_protocol = ?, snmp_context = ?
WHERE device_id = ?',
[
$device['device_type_id'], $device['scan_type'], $device['snmp_version'],
Expand Down
15 changes: 15 additions & 0 deletions tests/Unit/DeviceEditSnmpUpdateSqlTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDtool-based Graphing Solution |
+-------------------------------------------------------------------------+
*/

it('does not leave a trailing comma before WHERE in any mac_track_devices UPDATE', function () {
$source = plugin_test_read_source('mactrack_devices.php');

expect(preg_match('/,\s*WHERE\b/i', $source))->toBe(0);
expect($source)->toContain("snmp_context = ?\n\t\t\t\t\t\t\t\tWHERE device_id = ?");
});
Loading