There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-0dac3477-1277-4f26-b077-ed7002e6db1c XWIKI-22754 Open

Use noavatar.png instead of noavatargroup.png for non-existing groups in macros.vm

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-bcd08a8e-c60e-46c5-b07c-7efc13bc171b Nikita Petrenko on 30/Jul/25 13:57
 
I unassigned it from myself, since based on my findings it's not a bug but , as expected result due to lack of API in XWiki platform. Will update this comment

We have only [UserAvatarMacro|https://github.com/xwiki/xwiki-platform/blob/58a9ee5ac3950163a6fb96af3a3e1675ee5368b0/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-useravatar/src/main/java/org/xwiki/rendering/internal/macro/useravatar/UserAvatarMacro.java]
in next minutes XWiki, which sets default or displayed uploaded one. The macro in Velocity or as Java class for GroupAvatar doesn't exist at all in XWiki. The only usage can be found in [test method|https://github.com/xwiki/xwiki-platform/blob/91a3e1e40ab38dfba09140721aafe7960ad40b89/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/test/java/org/xwiki/rest/internal/resources/classes/GroupsClassPropertyValuesProviderTest.java#L70-L78] which if I understand correctly on attempts to get the path to the noavatargroup.png icon, it will receive the hardcoded string "url/to/noavatar.png". The macros.vm only using getUserAvatar macro and delete created there's no way that creating a new macro there, it won't work because there's an ambiguous case that I mentioned later in comment and in PR.

From my point of view, this issue can be resolved either by transforming reported bug into improvement, or by creating a new ticket with improvement that will introduce [GroupAvatar|https://github.com/xwiki/xwiki-platform/tree/58a9ee5ac3950163a6fb96af3a3e1675ee5368b0/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros]