Issue with Group Symbol in AWM App Field of Type 'Group'

When selecting a non-existent group in an AWM field of type ‘group,’ the correct symbol is displayed in the dropdown list and preview (after saving at least one sheet with the non-existent group as entry). However, after saving, the symbol is incorrectly replaced with a user symbol. See the screenshots below for reference:



If this issue is reproducible, I would open a ticket on Jira.

I investigated the issue by reviewing the source code and believe I have identified the bug in macros.vm. The following code considers anything without an avatar that is not an existing group as a user without an avatar.

#if ($profileDoc.getObject('XWiki.XWikiGroups'))
    #set ($url = $xwiki.getSkinFile('icons/xwiki/noavatargroup.png', true))
  #else
    #set ($url = $xwiki.getSkinFile('icons/xwiki/noavatar.png', true))
  #end

I created XWIKI-22754 for the issue…