Skip to content

Commit 7edcd47

Browse files
authored
Clear exception count and warnings after encrypted content is cleared (#7538)
1 parent c1cbdad commit 7edcd47

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

api/src/org/labkey/api/security/Encryption.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,9 @@ public static void deleteEncryptedContent(User user)
672672
event.setChanges(changes);
673673
AuditLogService.get().addEvent(user, event);
674674
CacheManager.clearAllKnownCaches();
675+
// Reset the counter and clear the warnings
676+
DECRYPTION_EXCEPTIONS.set(0);
677+
WarningService.get().clearStaticWarnings();
675678
LOG.info("Finished deleting all encrypted content");
676679
}
677680

api/src/org/labkey/api/view/template/WarningService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,5 @@ static void setInstance(WarningService impl)
4242
Warnings getWarnings(@Nullable ViewContext context);
4343
HtmlString getWarningsHtml(Warnings warnings, ViewContext context);
4444
void rerunSchemaCheck(); // Doesn't really fit on this service, but there's no better existing service
45+
void clearStaticWarnings();
4546
}

core/src/org/labkey/core/admin/AdminController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3688,7 +3688,7 @@ public AttachmentsForTypeAction()
36883688
public void addNavTrail(NavTree root)
36893689
{
36903690
String parentType = getViewContext().getActionURL().getParameter("core.ParentType~eq");
3691-
addAdminNavTrail(root, "Documents Belonging to Parent Type" + (parentType != null ? " \"" + parentType + "\"" : ""), getClass());
3691+
addAdminNavTrail(root, parentType != null ? "Documents Belonging to Parent Type \"" + parentType + "\"" : "Documents", getClass());
36923692
}
36933693
}
36943694

core/src/org/labkey/core/view/template/bootstrap/WarningServiceImpl.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private static class LazyInitializer
6161
SHOW_ALL_WARNINGS = OptionalFeatureService.get().isFeatureEnabled(EXPERIMENTAL_SHOW_ALL_WARNINGS);
6262
OptionalFeatureService.get().addFeatureListener(EXPERIMENTAL_SHOW_ALL_WARNINGS, (feature, enabled) -> {
6363
SHOW_ALL_WARNINGS = enabled;
64-
clearStaticWarnings(); // Force static warnings to be re-collected since flag has changed
64+
WarningService.get().clearStaticWarnings(); // Force static warnings to be re-collected since flag has changed
6565
});
6666
}
6767
}
@@ -86,7 +86,8 @@ public void register(WarningProvider provider)
8686
clearStaticWarnings();
8787
}
8888

89-
private static void clearStaticWarnings()
89+
@Override
90+
public void clearStaticWarnings()
9091
{
9192
synchronized (STATIC_WARNING_LOCK)
9293
{
@@ -194,7 +195,7 @@ private void appendMessageContent(Warnings warnings, HtmlStringBuilder html)
194195
List<HtmlString> messages = warnings.getMessages();
195196

196197
if (messages.size() == 1)
197-
html.append(messages.get(0));
198+
html.append(messages.getFirst());
198199
else
199200
{
200201
html.startTag("ul");

0 commit comments

Comments
 (0)