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

The ResourcePermission table is not populated with a primKeyId value in some situations

    Details

      Description

      This regression is caused by LPS-118989, see its change here:

      The UpgradeResourcePermission._updatePrimKeyIdsByName method populates the primKeyId.

      To fix this issue we have to replace primKeyId != 0 with primKeyId IS NULL

      This problem is only produced in case you have a primKey value that:

      • It is equal to zero
      • It is not numeric but it is not a %_ LAYOUT_ % value either.

      Steps to reproduce

      1. Install a new Liferay Portal 6.2 in a clean database
      2. Execute this insert to force the primKeysArray is populated during the upgrade:
        • INSERT INTO ResourcePermission (resourcePermissionId,companyId,name,scope,primKey,roleId,ownerId,actionIds) VALUES (99999,0,'com.liferay.portal.model.Role',0,'test',0,0,0);
      3. Upgrade from 6.2 to 7.2, 7.3 or master
      4. Execute this SQL:
        select * from ResourcePermission where primKeyId IS NULL
        • Expected result: the query doesn't return anything
        • Wrong result: the query returns all the com.liferay.portal.kernel.model.Role entries as the primKeyId wasn't correctly populated

      (note: during the upgrade, the com.liferay.portal.model.Role entries are renamed to com.liferay.portal.kernel.model.Role)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              summer.zhang Summer Zhang
              Reporter:
              jorge.diaz Jorge Diaz
              Participants of an Issue:
              Recent user:
              Tomáš Polešovský
              Engineering Assignee:
              Jorge Diaz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                16 weeks ago

                  Packages

                  Version Package
                  7.2.X
                  7.3.7 CE GA8
                  7.3.10 DXP FP2
                  7.3.X
                  7.4.1 CE GA2 DXP 7,4
                  Master