From 65006f66fc744e4f89c79b69075aff98080167dd Mon Sep 17 00:00:00 2001 From: Sam Ottenhoff Date: Tue, 18 Oct 2016 21:07:57 -0400 Subject: [PATCH] SAK-31857 dont load hidden sites from preferences when loading synoptic announcements (#3467) --- .../announcement/tool/AnnouncementAction.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/announcement/announcement-tool/tool/src/java/org/sakaiproject/announcement/tool/AnnouncementAction.java b/announcement/announcement-tool/tool/src/java/org/sakaiproject/announcement/tool/AnnouncementAction.java index 5fbf8e4f9b5a..b40c35840192 100644 --- a/announcement/announcement-tool/tool/src/java/org/sakaiproject/announcement/tool/AnnouncementAction.java +++ b/announcement/announcement-tool/tool/src/java/org/sakaiproject/announcement/tool/AnnouncementAction.java @@ -357,18 +357,18 @@ public String makeReference(String siteId) class EntryProvider extends MergedListEntryProviderBase { /** announcement channels from hidden sites */ - private final List excludedSites = new ArrayList(); + private final List hiddenSites = new ArrayList(); public EntryProvider() { this(false); } - public EntryProvider(boolean excludeHiddenSites) { - if (excludeHiddenSites) { + public EntryProvider(boolean includeHiddenSites) { + if (includeHiddenSites) { List excludedSiteIds = getExcludedSitesFromTabs(); if (excludedSiteIds != null) { for (String siteId : excludedSiteIds) { - excludedSites.add(AnnouncementService.channelReference(siteId, SiteService.MAIN_CONTAINER)); + hiddenSites.add(AnnouncementService.channelReference(siteId, SiteService.MAIN_CONTAINER)); } } } @@ -413,7 +413,7 @@ public boolean allowGet(String ref) SecurityAdvisor advisor = getChannelAdvisor(ref); try { m_securityService.pushAdvisor(advisor); - return (!excludedSites.contains(ref) && AnnouncementService.allowGetChannel(ref)); + return (!hiddenSites.contains(ref) && AnnouncementService.allowGetChannel(ref)); } finally { m_securityService.popAdvisor(advisor); } @@ -1576,7 +1576,7 @@ private List getMessages(AnnouncementChannel defaultChannel, Filter filter, bool } } mergedAnnouncementList.loadChannelsFromDelimitedString(isOnWorkspaceTab(), new MergedListEntryProviderFixedListWrapper( - new EntryProvider(true), state.getChannelId(), channelArrayFromConfigParameterValue, + new EntryProvider(false), state.getChannelId(), channelArrayFromConfigParameterValue, new AnnouncementReferenceToChannelConverter()), StringUtil.trimToZero(SessionManager .getCurrentSessionUserId()), channelArrayFromConfigParameterValue, m_securityService.isSuperUser(), ToolManager.getCurrentPlacement().getContext()); @@ -4499,7 +4499,7 @@ protected void initState(SessionState state, VelocityPortlet portlet, JetspeedRu } mergedAnnouncementList.loadChannelsFromDelimitedString(isOnWorkspaceTab(), new MergedListEntryProviderFixedListWrapper( - new EntryProvider(true), annState.getChannelId(), channelArrayFromConfigParameterValue, + new EntryProvider(false), annState.getChannelId(), channelArrayFromConfigParameterValue, new AnnouncementReferenceToChannelConverter()), StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()), channelArrayFromConfigParameterValue, m_securityService.isSuperUser(), ToolManager.getCurrentPlacement().getContext());