Skip to content

Commit cae6fbe

Browse files
authored
Merge pull request #1802 from hashtopolis/1799-bug-legacy-agent-type-checking-not-working-properly
Fixed bug in legacy agentbinary update, by directly performing update…
2 parents d6444f1 + 6321130 commit cae6fbe

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/inc/Util.class.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,16 @@ public static function checkAgentVersionLegacy($type, $version, $silent = false)
216216
if (!$silent) {
217217
echo "update $type version... ";
218218
}
219-
Factory::getAgentBinaryFactory()->set($binary, AgentBinary::VERSION, $version);
219+
220+
$query = "UPDATE " . $agentBinaryFactory->getModelTable() . " SET " . AgentBinary::VERSION . "=?";
221+
222+
$values = [];
223+
$query = $query . " WHERE " . $binary->getPrimaryKey() . "=?";
224+
$values[] = $version;
225+
$values[] = $binary->getPrimaryKeyValue();
226+
227+
$stmt = $dbh->prepare($query);
228+
$stmt->execute($values);
220229
if (!$silent) {
221230
echo "OK";
222231
}

0 commit comments

Comments
 (0)