Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25914

Adding wiki members who are already members saves a new version of the members group

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 18.10.0
    • Wiki
    • None
    • Unknown

    Description

      Adding several users to a wiki at once (WikiUserManager#addMembers, e.g. through $services.wiki.user.addMembers or when creating a wiki with members) saves a new version of the XWiki.XWikiAllGroup page of the wiki even when all the users are already members, and adds a user twice when the list contains it twice. From the UI, this happens when creating a wiki whose only selected member is its owner, who is already a member.

      STEPS TO REPRODUCE:

      1. Create a subwiki "sub" and a user U.
      2. Run $services.wiki.user.addMembers(['XWiki.U'], 'sub') twice (with admin right on the wiki).
      3. Run $services.wiki.user.addMembers(['XWiki.V', 'XWiki.V'], 'sub').
      4. Look at the history and the objects of sub:XWiki.XWikiAllGroup.

      EXPECTED RESULTS:
      One new version for U, one for V, and one member object each.

      ACTUAL RESULTS:
      Each call creates a new version, and V has two member objects.

      Found while working on XWIKI-22643.

      Attachments

        Issue Links

          Activity

            People

              MichaelHamann Michael Hamann
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: