From 5e9ce84c175c83e19cd10e575aa9a5f7468fd3bd Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 9 Dec 2013 12:22:54 +0100 Subject: [PATCH] Fix duplicate IDs in queries for comments/downtimes. Fixes #5283 --- lib/db_ido/servicedbobject.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/db_ido/servicedbobject.cpp b/lib/db_ido/servicedbobject.cpp index fe23f8c30..b9a5cd7d5 100644 --- a/lib/db_ido/servicedbobject.cpp +++ b/lib/db_ido/servicedbobject.cpp @@ -327,6 +327,9 @@ void ServiceDbObject::AddComments(const Service::Ptr& service) ObjectLock olock(comments); + if (comments->GetLength() > 0) + RemoveComments(service); + BOOST_FOREACH(const Dictionary::Pair& kv, comments) { AddComment(service, kv.second); } @@ -489,6 +492,9 @@ void ServiceDbObject::AddDowntimes(const Service::Ptr& service) ObjectLock olock(downtimes); + if (downtimes->GetLength() > 0) + RemoveDowntimes(service); + BOOST_FOREACH(const Dictionary::Pair& kv, downtimes) { AddDowntime(service, kv.second); } -- 2.40.0