From 7e1253bf435339241c87c8fd4b8b1765abaafe18 Mon Sep 17 00:00:00 2001 From: Rune Darrud Date: Sat, 20 Mar 2021 11:40:26 +0100 Subject: [PATCH] Fix issue with updating traps Fix an "array to string" conversion problem for traps that are already present in the database. The issue I've come across that this fixes is that instead of passing an entire array, it now passes just the ID's to make the query work instead of aborting the process. On the next run without this fix, it thinks the trap is already imported and skips it. --- library/Trapdirector/TrapsProcess/MibDatabase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Trapdirector/TrapsProcess/MibDatabase.php b/library/Trapdirector/TrapsProcess/MibDatabase.php index 3031984..0932965 100644 --- a/library/Trapdirector/TrapsProcess/MibDatabase.php +++ b/library/Trapdirector/TrapsProcess/MibDatabase.php @@ -80,7 +80,7 @@ private function update_oid_update() ':syntax' => $this->oidDesc['syntax']==null??'null', ':type_enum' => $this->oidDesc['type_enum']??'null', ':description' => $this->oidDesc['description']??'null', - ':id' => $this->dbOidAll[$this->dbOidIndex[$this->oidDesc['oid']]['id']] + ':id' => $this->dbOidIndex[$this->oidDesc['oid']]['id'] ); if ($sqlQuery->execute($sqlParam) === false) { @@ -191,4 +191,4 @@ private function cache_db_objects($trapId) } -} \ No newline at end of file +}