PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-24741

UserLocalServiceImpl.addDefaultGroups causes an issue when you have the same portal account name as an existing site

    Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Fix Priority:
      3
    • Added to Fix Pack:
      Added
    • Similar Issues:
      Show 5 results 

      Description

      Download and install Liferay 6.1 CE GA 1
      Run Liferay
      Login as test@liferay.com
      Go to Control panel / Sites
      Create new site called 'myCompany' with the Membership Type restricted
      Go to Control panel / Portal Settings / General
      Update Main Configuration / Name with the same name: 'myCompany' and save you changes
      Go to Portal Settings / Users and Organizations / Default User Associations
      Update Sites with 'myCompany' and save you changes

      Go to Users and Organizations and create a new user

      After you have created the user go to users detail page go to Sites tab
      User has now one site myCompany which is the default guest site "community" instead of the site you have created.
      This happens because in Liferay 6.1 you have changed the code in UserLocalServiceImpl.addDefaultGroups :

      UserLocalServiceImpl.addDefaultGroups(long userId)

      Company company = companyPersistence.findByPrimaryKey(
      user.getCompanyId());

      Account account = company.getAccount();

      if (defaultGroupName.equalsIgnoreCase(account.getName())) {
      defaultGroupName = GroupConstants.GUEST;
      }

      Company company = companyPersistence.findByPrimaryKey(
      user.getCompanyId());

      Account account = company.getAccount();

      if (defaultGroupName.equalsIgnoreCase(account.getName())) {
      defaultGroupName = GroupConstants.GUEST;
      }

      The issue accrues because of the following check:
      if (defaultGroupName.equalsIgnoreCase(account.getName())) {
      defaultGroupName = GroupConstants.GUEST;
      }

      Fix:
      Please make this check configurable.

        Activity

        Hide
        Drew Blessing added a comment -

        Alireza,

        Thank you for your report. As part of the community verifier program I am taking a look at this issue. In the meantime, if you have any other information about this issue please add a comment to let me know.

        Thanks!

        Show
        Drew Blessing added a comment - Alireza, Thank you for your report. As part of the community verifier program I am taking a look at this issue. In the meantime, if you have any other information about this issue please add a comment to let me know. Thanks!
        Hide
        Drew Blessing added a comment -

        Steps to reproduce:
        1. Go to Control Panel -> Sites
        2. Create new blank site called 'myCompany' with the Membership Type restricted
        3. Go to Control Panel -> Portal Settings
        4. Update portal Name with 'myCompany'
        5. Also in Portal Settings, go to Users -> Default User Associations
        6. Add 'myCompany' in Sites text box.
        7. Create a new user
        8. Go to Sites page while viewing the new user's information.
        Notice the default site association refers to the portal's default community site rather than the new site that was created.

        Show
        Drew Blessing added a comment - Steps to reproduce: 1. Go to Control Panel -> Sites 2. Create new blank site called 'myCompany' with the Membership Type restricted 3. Go to Control Panel -> Portal Settings 4. Update portal Name with 'myCompany' 5. Also in Portal Settings, go to Users -> Default User Associations 6. Add 'myCompany' in Sites text box. 7. Create a new user 8. Go to Sites page while viewing the new user's information. Notice the default site association refers to the portal's default community site rather than the new site that was created.
        Hide
        Michael Saechang added a comment -

        Updated ticket as per Drew's comment. Thank you for verifying.

        Show
        Michael Saechang added a comment - Updated ticket as per Drew's comment. Thank you for verifying.
        Hide
        Michael Saechang added a comment -

        Committed on:
        6.1.x GIT ID: d0e1a6298d5b20074c6b0e43c3cda6bb3c81a0ba.
        6.2.x GIT ID: 8d325824f6f4fce845bf245744037e94903dede5.

        Show
        Michael Saechang added a comment - Committed on: 6.1.x GIT ID: d0e1a6298d5b20074c6b0e43c3cda6bb3c81a0ba. 6.2.x GIT ID: 8d325824f6f4fce845bf245744037e94903dede5.
        Hide
        Pani Gui (Inactive) added a comment -

        PASSED Manual Testing following the steps in Drew's comment.

        Reproduced on:
        Tomcat 7.0 + MySQL 5. 6.1.x GIT ID: 78a2e4fbf1aeb3ead4b44da1dd1039a5a1f40495.
        Tomcat 7.0 + MySQL 5. 6.2.x GIT ID: b4125271eaf5dacbc3ee417cf63bc1f06ba0b2a7.

        Portal name can rename to existing site.

        Fixed on:
        Tomcat 7.0 + MySQL 5. 6.1.x GIT ID: a704f4e2ee2bade4d922f099595e226c4e0e2ba3.
        Tomcat 7.0 + MySQL 5. 6.2.x GIT ID: 291f6741b32a64b3e792c41ed3af89c245aeba61.

        Portal name can't rename to existing site.

        Show
        Pani Gui (Inactive) added a comment - PASSED Manual Testing following the steps in Drew's comment. Reproduced on: Tomcat 7.0 + MySQL 5. 6.1.x GIT ID: 78a2e4fbf1aeb3ead4b44da1dd1039a5a1f40495. Tomcat 7.0 + MySQL 5. 6.2.x GIT ID: b4125271eaf5dacbc3ee417cf63bc1f06ba0b2a7. Portal name can rename to existing site. Fixed on: Tomcat 7.0 + MySQL 5. 6.1.x GIT ID: a704f4e2ee2bade4d922f099595e226c4e0e2ba3. Tomcat 7.0 + MySQL 5. 6.2.x GIT ID: 291f6741b32a64b3e792c41ed3af89c245aeba61. Portal name can't rename to existing site.
        Hide
        Edward Gonzales added a comment -

        Slated for inclusion in 6.1.1 CE GA2

        Show
        Edward Gonzales added a comment - Slated for inclusion in 6.1.1 CE GA2

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 5 weeks, 3 days ago

              Development

                Structure Helper Panel