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

When importing LARs for new users, the layout tree structure is getting messed up

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: No Longer Reproducible
    • Affects Version/s: 5.2.3
    • Fix Version/s: 6.1.0 CE RC1
    • Labels:
      None
    • Liferay Contributor's Agreement:
      Accept

      Description

      When importing simple page structures (with 3 levels), the layoutIds and parentLayoutIds get messed up. A simple solution for this problem is changing the code of the method

      public void importLayouts(
      long userId, long groupId, boolean privateLayout,
      Map<String, String[]> parameterMap, InputStream is)
      throws PortalException, SystemException {

      in the package com.liferay.portal.lar.LayoutImporter in such way:

      AT LINE 407
      else if (layoutsImportMode.equals(
      PortletDataHandlerKeys.
      LAYOUTS_IMPORT_MODE_MERGE_BY_LAYOUT_NAME)) {

      Locale locale = LocaleUtil.getDefault();

      String localizedName = LocalizationUtil.getLocalization(
      name, LocaleUtil.toLanguageId(locale));

      for (Layout curLayout : previousLayouts) {
      if (curLayout.getName(locale).equals(localizedName))

      { layout = curLayout; break; }

      }

      if (layout == null)

      { //------------------------------------------------------------------------------------------------------------------------------- //-------------COMMENT THE FOLLOWING LINE OUT TO GET THE LAYOUT IMPORT RIGHT ------ //------------------------------------------------------------------------------------------------------------------------------- // layoutId = LayoutLocalServiceUtil.getNextLayoutId( // groupId, privateLayout); //------------------------------------------------------------------------------------------------------------------------------- //-------------COMMENT THE FOLLOWING LINE OUT TO GET THE LAYOUT IMPORT RIGHT ------ //------------------------------------------------------------------------------------------------------------------------------- }

      }
      else

      { layout = LayoutUtil.fetchByG_P_L( groupId, privateLayout, layoutId); }

      With the above changes, everything works the way expected

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                7 years, 14 weeks, 3 days ago