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

6.2 Upgrade fails with duplicate DB keys

    Details

      Description

      Steps to reproduce:

      1. Apply LPS-46501-Update-UpgradeCustomizablePortletsTest.patch on UpgradeCustomizablePortlets
      2. Run the integration test (ant test-class -Dtest.class=UpgradeCustomizablePortletsTest)

      Result: Test will fail with the exception in test_fail.txt

      Problem:
      If you have an instanciable portlet in a customizable section and an other one with the same portletId on an other layout (for example: page was created from a template or a lar was imported to multiple sites) upgrade to 6.2 will fail because of trying to add duplicate key to unique index 'IX_C7057FF7'.

      Cause:
      UpgradeCustomizablePortlets line 166

      ps = con.prepareStatement(
      	"update PortletPreferences set ownerId = ?, ownerType = ?, " +
      		"plid = ?, portletId = ? where ownerId = ? and " +
      			"ownerType = ? and portletId = ?");
      

      It selects portletPreferences record based on ownerId and ownerType and portletId which is not unique without the plid.

      Solution:
      Add plid to WHERE clause.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                brian.chan Brian Chan
                Reporter:
                norbert.kocsis Norbert Kocsis (Inactive)
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

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

                  Packages

                  Version Package
                  6.2.2 CE GA3
                  6.2.X EE
                  7.0.0 M1