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

When upgrading to DXP, PortletIDs can become too long, resulting in truncation

    Details

      Description

      Description:
      When upgrading to DXP, some portletIds may become too long during the upgrade process, resulting in "java.sql.BatchUpdateException: String or binary data would be truncated" error.

      This is because we are replacing the oldPortletId incorrectly. Rather than replacing the first instance of the portletId, or the portletId appended with an underscore, we replace just the portlet id. When upgrading a portlet with the following id : 56_USER_5566856_INSTANCE_HNiazbHID1Ni, the portletId '56' is replaced three times, resulting in a new portletId which is too many characters for the DB to handle (and incorrect). The new portletId looks something like: com_liferay_journal_content_web_portlet_JournalContentPortlet_USER_5com_liferay_journal_content_web_portlet_JournalContentPortlet68com_liferay_journal_content_web_portlet_JournalContentPortlet_INSTANCE_HNiazbHID1Ni

      Steps to Reproduce:

      1. Start a 6.2 instance
      2. have a portlet with a portletId which appears multiple times (such as 56_USER_5566856_INSTANCE_HNiazbHID1Ni)
      3. Upgrade to DXP

      Expected Results:
      Portlet upgrades normally and DXP upgrade is successful

      Actual Results:
      PortletID balloons up due to improper string replacement, does not insert into DB, and DXP upgrade is unsuccessful.

      Reproduced:
      Master: c5a659b5a39c7f3ef2ec613a2f0b7072a0578a85
      NOTE: I didn't actually reproduce on this githash, however the problematic code is still present.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 29 weeks, 4 days ago

                Packages

                Version Package
                7.0.0 DXP FP13
                7.0.0 DXP SP3
                7.0.3 CE GA4
                7.0.X EE
                7.1.X
                Master