From 633ecab126f33ae2fdcbe2c5f837c645bbb29cef Mon Sep 17 00:00:00 2001 From: Ross Murphy Date: Wed, 12 Jun 2024 11:10:15 +0100 Subject: [PATCH] fix issue in vulnerabilityaudit where wrong projects shown when show inactive projects is selected --- .../persistence/FindingsSearchQueryManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/dependencytrack/persistence/FindingsSearchQueryManager.java b/src/main/java/org/dependencytrack/persistence/FindingsSearchQueryManager.java index 06ae79c2df..c6c495787a 100644 --- a/src/main/java/org/dependencytrack/persistence/FindingsSearchQueryManager.java +++ b/src/main/java/org/dependencytrack/persistence/FindingsSearchQueryManager.java @@ -103,7 +103,7 @@ public class FindingsSearchQueryManager extends QueryManager implements IQueryMa public PaginatedResult getAllFindings(final Map filters, final boolean showSuppressed, final boolean showInactive) { StringBuilder queryFilter = new StringBuilder(); Map params = new HashMap<>(); - if (showInactive) { + if (!showInactive) { queryFilter.append(" WHERE (\"PROJECT\".\"ACTIVE\" = :active OR \"PROJECT\".\"ACTIVE\" IS NULL)"); params.put("active", true); } @@ -161,7 +161,7 @@ public PaginatedResult getAllFindings(final Map filters, final b public PaginatedResult getAllFindingsGroupedByVulnerability(final Map filters, final boolean showInactive) { StringBuilder queryFilter = new StringBuilder(); Map params = new HashMap<>(); - if (showInactive) { + if (!showInactive) { queryFilter.append(" WHERE (\"PROJECT\".\"ACTIVE\" = :active OR \"PROJECT\".\"ACTIVE\" IS NULL)"); params.put("active", true); }