Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-22754: Use noavatar.png instead of noavatargroup.png for non-existing groups in macros.vm #3896

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ $xwiki.getUserName("xwiki:${username}")
#macro(getUserAvatarURL $userName $return $size)
#set ($specified = false)
#set ($profileDoc = $xwiki.getDocument($userName))
#if ($profileDoc.getObject('XWiki.XWikiGroups'))
#if ($profileDoc.getObject('XWiki.XWikiGroups') || !$profileDoc.getObject('XWiki.XWikiGroups'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of this condition? Isn't this equivalent to true? And doesn't this mean it will always display noavatargroup and never noavatar even if it is actually a user?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, for not existing user it will use noavatargroup image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't why but else statement won't never checked if I change statement for checking XWiki.XWikiUsers instead of XWiki.XWikiGroups

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now I'll convert it to draft PR

#set ($url = $xwiki.getSkinFile('icons/xwiki/noavatargroup.png', true))
#else
#set ($url = $xwiki.getSkinFile('icons/xwiki/noavatar.png', true))
Expand Down