]> granicus.if.org Git - icinga2/commitdiff
Fix aggregation of the type and is_service livestatus comment columns
authorJohannes Meyer <johannes.meyer@netways.de>
Mon, 16 Dec 2013 14:36:38 +0000 (15:36 +0100)
committerJohannes Meyer <johannes.meyer@netways.de>
Mon, 16 Dec 2013 14:36:38 +0000 (15:36 +0100)
refs #5332

components/livestatus/commentstable.cpp

index c77ea587d156d21adca80f3584391081b548b80d..3b36805a9ed035053fa0d510a324fa82e5bc82d3 100644 (file)
@@ -119,7 +119,8 @@ Value CommentsTable::EntryTimeAccessor(const Value& row)
 
 Value CommentsTable::TypeAccessor(const Value& row)
 {
-       Service::Ptr svc = Service::GetOwnerByCommentID(row);
+       Comment::Ptr comment = static_cast<Comment::Ptr>(row);
+       Service::Ptr svc = Service::GetOwnerByCommentID(comment->GetId());
 
        if (!svc)
                return Empty;
@@ -129,7 +130,8 @@ Value CommentsTable::TypeAccessor(const Value& row)
 
 Value CommentsTable::IsServiceAccessor(const Value& row)
 {
-       Service::Ptr svc = Service::GetOwnerByCommentID(row);
+       Comment::Ptr comment = static_cast<Comment::Ptr>(row);
+       Service::Ptr svc = Service::GetOwnerByCommentID(comment->GetId());
 
        if (!svc)
                return Empty;