Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-131525

UserGroupGroupRole is not overriding equals

    Details

      Description

      Reproduction steps:

      1. Start 6.2
      2. Create a user group
      3. Assign this user group to the default site and assign a role
      4. Switch on Local Staging
      5. Run the script with your values to assign the role to the staged group too:
        import com.liferay.portal.service.UserGroupGroupRoleLocalServiceUtil;
        
        long userGroupId= ; //your usergroupid
        long groupId= ; //staging groupid
        long[] roleIds = [20169];  // the same roleid that you assigned at step 2)
        UserGroupGroupRoleLocalServiceUtil.addUserGroupGroupRoles( userGroupId,  groupId,  roleIds); 
        
      6. Upgrade to 7.3

      Expected behaviour: Upgrade finishes with no Exceptions
      Actual behaviour: Upgrade finishes with

      2021-04-07 17:13:28.433 ERROR [main][JDBCExceptionReporter:234] Duplicate entry '50226948-9287595-11813497-0' for key 'IX_B384D815'
      
      Caused by: org.springframework.dao.DataIntegrityViolationException: could not update: [com.liferay.portal.model.impl.UserGroupGroupRoleImpl#981]; SQL [update UserGroupGroupRole set mvccVersion=?, groupId=? where userGroupGroupRoleId=? and mvccVersion=?]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not update: [com.liferay.portal.model.impl.UserGroupGroupRoleImpl#981]
      	at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:660)
      	at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:800)
      	at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:671)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.commit(DefaultTransactionExecutor.java:41)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
      	at com.liferay.portal.kernel.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:64)
      	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
      	at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
      	at com.sun.proxy.$Proxy166.updateUserGroupGroupRole(Unknown Source)
      	at com.liferay.portal.kernel.service.UserGroupGroupRoleLocalServiceUtil.updateUserGroupGroupRole(UserGroupGroupRoleLocalServiceUtil.java:415)
      	at com.liferay.portal.verify.VerifyGroup.verifyStagingUserGroupGroupRolesAssignments(VerifyGroup.java:234)
      	at com.liferay.portal.verify.VerifyGroup.verifyStagedGroups(VerifyGroup.java:83)
      	at com.liferay.portal.verify.VerifyGroup.doVerify(VerifyGroup.java:53)
      	at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:71)
      	... 10 more
      

        Attachments

          Activity

            People

            Assignee:
            sharry.shi Sharry Shi
            Reporter:
            balazs.safrany-kovalik Balázs Sáfrány-Kovalik
            Participants of an Issue:
            Recent user:
            Sophia Zhang
            Engineering Assignee:
            Balázs Sáfrány-Kovalik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 5 days ago

                Packages

                Version Package
                7.4.1 CE GA2 DXP 7,4
                7.4.13 DXP GA1
                Master