1. A page is defined as a group page, when it has at least one object of xclass XWiki.XWikiGroups 1. Thus when we create a group, it's empty and has 1 xobject of xclass XWiki.XWikiGroups (with no user defined) 1. Empty groups are displayed on /xwiki/bin/view/XWiki/XWikiGroups
I think what Sergiu meant is that we would need 2 xclasses:
one for identifying a page as a Group
another one to list members of the group
This would allow having a group without any user and would also fix the issue that we still have: when a user is added to a group a new XWiki.XWikiGroups xobject is added instead of replacing the existing empty XWiki.XWikiGroups.
OTOH, we could also leave it as it is now (as it may be hard to fix for backward-compatible reasons), and simply make sure that when we add the 1st user, we reuse the existing empty XWiki.XWikiGroups xobject instead of adding a new one. That looks simple enough but the downside is that the /xwiki/bin/view/XWiki/XWikiGroups UI would still indicate (Object count = 1 for empty groups):
But that could be fixed too by excluding empty xobjects from the count.
WDYT?
Vincent Massol on 29/Jan/26 10:56
To be clear:
1.# A page is defined as a group page, when it has at least one object of xclass {{XWiki.XWikiGroups}} 1.# Thus when we create a group, it's empty and has 1 xobject of xclass {{XWiki.XWikiGroups}} (with no user defined) 1.# Empty groups are displayed on /xwiki/bin/view/XWiki/XWikiGroups
I think what Sergiu meant is that we would need 2 xclasses: * one for identifying a page as a Group * another one to list members of the group
This would allow having a group without any user and would also fix the issue that we still have: when a user is added to a group a new {{XWiki.XWikiGroups}} xobject is added instead of replacing the existing empty {{XWiki.XWikiGroups}}.
OTOH, we could also leave it as it is now (as it may be hard to fix for backward-compatible reasons), and simply make sure that when we add the 1st user, we reuse the existing empty {{XWiki.XWikiGroups}} xobject instead of adding a new one. That looks simple enough but the downside is that the /xwiki/bin/view/XWiki/XWikiGroups UI would still indicate (Object count = 1 for empty groups):
!empty-groups.png|thumbnail!
But that could be fixed too by excluding empty xobjects from the count.
WDYT?
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.