Skip to content

Commit bdb2cd2

Browse files
authored
SAK-50530 Roster noisy log message about creating profile tool link (#13411)
1 parent 59738b7 commit bdb2cd2

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

Diff for: roster2/tool/src/java/org/sakaiproject/roster/impl/SakaiProxyImpl.java

+5-12
Original file line numberDiff line numberDiff line change
@@ -1237,22 +1237,15 @@ public Boolean getViewUserNamePronunciation() {
12371237

12381238
@Override
12391239
public String getProfileToolLink(String otherUserId, String siteId) {
1240-
12411240
try {
12421241
Site site = siteService.getSite(siteService.getUserSiteId(getCurrentUserId()));
1243-
return Optional.ofNullable(site.getToolForCommonId("sakai.profile2")).map(tc -> {
1244-
1245-
return site.getUrl() + "/tool/" + tc.getId()
1246-
+ (StringUtils.isNotBlank(otherUserId) ? "/viewprofile/" + otherUserId + "?fromSiteId=" + siteId : "");
1247-
}).orElseGet(() -> {
1248-
log.info("The current user has not got the profile tool added to their workspace");
1249-
return "";
1250-
});
1242+
return Optional.ofNullable(site.getToolForCommonId("sakai.profile2"))
1243+
.map(tc -> site.getUrl() + "/tool/" + tc.getId() + (StringUtils.isNotBlank(otherUserId) ? "/viewprofile/" + otherUserId + "?fromSiteId=" + siteId : ""))
1244+
.orElse(StringUtils.EMPTY);
12511245
} catch (Exception e) {
1252-
log.warn("Error getting profile tool link: {}", e.toString());
1246+
log.warn("Could not create profile tool link for site: {}, {}", siteId, e.toString());
12531247
}
1254-
1255-
return null;
1248+
return StringUtils.EMPTY;
12561249
}
12571250

12581251
@Override

0 commit comments

Comments
 (0)