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

The ResourcePermission table is not populated with a primKeyId and a viewActionId in the BaseAdminPortletsUpgradeProcess subclasses

    Details

      Description

      The ResourcePermission table is not populated with a primKeyId and a viewActionId in the ResourcePermission records created by com.liferay.portal.kernel.upgrade.BaseAdminPortletsUpgradeProcess subclasses. (BaseUpgradeAdminPortlets in the old 7.3.x branch)

      The primKeyId and viewActionId are populated in the com.liferay.portal.upgrade.v7_0_0.UpgradeResourcePermission class, but BaseUpgradeAdminPortlets subclasses are upgrade modules that are executed after that class:

      • modules/apps/bookmarks/bookmarks-web/src/main/java/com/liferay/bookmarks/web/internal/upgrade/v1_0_0/UpgradeAdminPortlets.java
      • modules/apps/document-library/document-library-web/src/main/java/com/liferay/document/library/web/internal/upgrade/v1_0_0/UpgradeAdminPortlets.java

      To avoid this issue, we have to populate these columns in the BaseAdminPortletsUpgradeProcess.addResourcePermission method.

      Steps to reproduce

      1. Install a Liferay 6.2
      2. Create a page
      3. Add the "Documents and media" portlet (non-Instanceable portlet) to the page
      4. Upgrade to Liferay 7.x or master
      5. Execute this SQL:
        select * from ResourcePermission where primKeyId IS NULL
        • Expected result: the query doesn't return anything
        • Wrong result: the query returns a com_liferay_document_library_web_portlet_DLAdminPortlet entry as the primKeyId wasn't correctly populated

      Note: the problematic upgrade was originally added in the LPS-48130

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              summer.zhang Summer Zhang
              Reporter:
              jorge.diaz Jorge Diaz
              Participants of an Issue:
              Recent user:
              Rafaela Nascimento
              Engineering Assignee:
              Jorge Diaz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 10 weeks, 3 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP102
                  7.0.10.16 DXP SP17
                  7.0.X
                  7.1.10 DXP FP25
                  7.1.X
                  7.2.10 DXP FP15
                  7.2.X
                  7.3.10.3 DXP SP3
                  7.3.X
                  7.4.1 CE GA2 DXP 7,4
                  7.4.13 DXP GA1
                  Master