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

Conversation

petrenkonikita112263
Copy link
Contributor

@petrenkonikita112263 petrenkonikita112263 commented Feb 12, 2025

Jira URL

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

Changes

Description

  • add extra condition

Clarifications

Screenshots & Video

Before

before fix

After

after fix

Executed Tests

Expected merging strategy

  • Prefers squash: Yes

…isting groups in macros.vm

* add extra condition
@petrenkonikita112263
Copy link
Contributor Author

My bad, if smth was changed in PR template and I didn't check before creation, I only noticed right now, in my mail that it returned error from backport action. I've removed mention of backport from PR description.

image

@@ -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

@petrenkonikita112263 petrenkonikita112263 marked this pull request as draft February 13, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants