I think, update on this issue is needed - remove Trivial from Difficulty entry, so this issue won't be listed in Paper Cuts.
Because, current code logic can't identify non-existent group. It fails because due check
$profileDoc.getObject('XWiki.XWikiGroups')
. I thought and tested by introducing
$profileDoc.isNew()
before the original if statement. For a new document equal as non-existent group, this check always fails, leading it to incorrectly result the else case (user default avatar).
pass additional information or to introduce a Velocity macro
getGroupAvatarURL
that only handles groups and could be called for fields that only allow groups.
Adding new parameter to current macro will raise extra refactoring. Introducing new macro - I'm not sure how could it be implemented as API doesn't have method to check whether group exist or not, with user it's easy
$services.user.exists($username)
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.