From 60d161329e6eca585249a7401f15161f7d408fed Mon Sep 17 00:00:00 2001 From: "nbotimer@unicon.net" Date: Tue, 31 Jan 2012 14:26:31 +0000 Subject: [PATCH] Merging to 2.8.x: SAK-21599 - Privacy status does not list your courses svn merge -c 103894 https://source.sakaiproject.org/svn/user/trunk . git-svn-id: https://source.sakaiproject.org/svn/user/branches/sakai-2.8.x@104228 66ffb92e-73f9-0310-93c1-f5514f145a0a --- .../src/java/org/sakaiproject/user/tool/PrivacyBean.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/user-tool-prefs/tool/src/java/org/sakaiproject/user/tool/PrivacyBean.java b/user-tool-prefs/tool/src/java/org/sakaiproject/user/tool/PrivacyBean.java index 9e7f44f..1a215cd 100644 --- a/user-tool-prefs/tool/src/java/org/sakaiproject/user/tool/PrivacyBean.java +++ b/user-tool-prefs/tool/src/java/org/sakaiproject/user/tool/PrivacyBean.java @@ -257,8 +257,12 @@ public SelectItem[] getSites() { * @return true if there are no sites for the current user OR false otherwise */ public boolean getSitesEmpty() { - // sites has 1 item in it even if there are no sites in it - return (this.sites == null || this.sites.length <= 1); + // getSites always adds My Workspace, so we know whether it has run or + // not by checking if sites is empty; this avoids an extra query if it has. + if (sites == null || sites.length == 0) { + getSites(); + } + return (sites == null || sites.length <= 1); } /** ========== processes iteraction on UI ========== */