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

Lar import fails with Name is null for locale French (France)

    Details

      Description

      If site 1 has a Form imported from an external site 2, then you change the language locale of site 1 and import a modification of the original form from site 2 the import will fail.

      Steps to reproduce on 70x:
      1. Startup Liferay with these properties defined in portal-ext.properties

      locales=zh_CN,es_ES,ja_JP,nl_NL,hu_HU,pt_BR,de_DE,iw_IL,fi_FI,ca_ES,fr_FR,en_US,ar_SA,en_GB,pl_PL,cs_CZ
      locales.enabled=ca_ES,zh_CN,nl_NL,en_US,fi_FI,fr_FR,de_DE,iw_IL,hu_HU,ja_JP,pt_BR,es_ES,en_GB,pl_PL,cs_CZ

      2. Create a France site and set the default language to English (UK) (site > configuration > site settings > languages)
      3. Create a new site UK on the same instance and set default language to English (UK)
      3. Create a new form on the UK site with test fields
      4. Export all forms (content > forms > three dots > export) and download the lar
      5. Import the lar to your France site with the default import/export configurations
      6. Change the France site default language to French
      7. Go back to the UK site and edit the form and create a new form
      8. Export all forms again and download the lar (three dots > export)
      9. Import the lar to your France site with the default import/export configurations
      *The import fails with the red "Name is null for locale French (France)" locale error and log error:

      2018-10-31 00:03:30.644 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:166] Unable to execute background task
      com.liferay.exportimport.kernel.lar.PortletDataException: com.liferay.portal.kernel.exception.ModelListenerException: com.liferay.dynamic.data.lists.exception.RecordSetNameException: Name is null for locale French (France)
          at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:438)
          at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:373)
          at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:359)
          at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.doImportReferenceStagedModel(StagedModelDataHandlerUtil.java:406)
          at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importReferenceStagedModel(StagedModelDataHandlerUtil.java:285)

      Expected behavior: LAR file imports without errors.
      Actual behavior: LAR file fails to import with message above.

      Not reproducible in master - however a Exception is thrown in master which code from LPS-77336 catches and handles.
      Steps to demonstrate Exception throw in master with debugger:

      1. Startup Liferay with these properties defined in portal-ext.properties
        locales=zh_CN,es_ES,ja_JP,nl_NL,hu_HU,pt_BR,de_DE,iw_IL,fi_FI,ca_ES,fr_FR,en_US,ar_SA,en_GB,pl_PL,cs_CZ
        locales.enabled=ca_ES,zh_CN,nl_NL,en_US,fi_FI,fr_FR,de_DE,iw_IL,hu_HU,ja_JP,pt_BR,es_ES,en_GB,pl_PL,cs_CZ
      1. Create a France site and set the default language to English (UK) (site > configuration > site settings > languages)
      2. Create a new site UK on the same instance and set default language to English (UK)
      3. From the UK Site, create a Dynamic Data List and when selecting a Data Definition, make a new Data Definition
      4. Export the Dynamic Data List from the top right of the Dynamic Data Lists portlet as "Export 1"
      5. Make a change to your Dynamic Data List then from the top right of the Dynamic Data Lists portlet click Data Definition and make a change to your Data Definition
      6. Export the Dynamic Data List again as "Export 2"
      7. Go to the France Site and import "Export 1" into the Dynamic Data Lists module
      8. Change the France site default language to French
      9. Begin the import process of "Export 2" in the Dynamic Data Lists module, but don't click Import
      10. Go to your IDE and put a break point on DDLRecordSetLocalServiceImpl.validateName(Map<Locale, String> nameMap) on the first line of
        if (Validator.isNull(name)) {
        			throw new RecordSetNameException(
        				"Name is null for locale " + locale.getDisplayName());
        		}
      1. Place another break point on StagedModelDataHandlerUtil.doImportReferenceStagedModel() on the first line in the catch of
        try {
        			importStagedModel(portletDataContext, referenceElement);
        		}
        		catch (PortletDataException pde) {
        			if (pde.getCause() instanceof NullPointerException) {
        				findReference = true;
        			}
        		}
      1. Click Import
        Actual Result:
      • Notice the IDE Debugger stops at validateName breakpoint and the name is null, this will throw an Exception
      • Let the Debugger run and see that the exception is caught at the doImportReferenceStagedModel catch.
        This same exception is thrown during the 70x steps above.
        Expected Result:
        The update of the DDLRecordSet using the RecordSet's old nameMap will not throw an exception.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                summer.zhang Summer Zhang
                Reporter:
                joshua.cords Joshua Cords
                Participants of an Issue:
                Recent user:
                Clarissa Velazquez
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  47 weeks ago

                  Packages

                  Version Package
                  7.0.0 DXP FP71
                  7.0.10.11 DXP SP11
                  7.0.X
                  7.1.10 DXP FP7
                  7.1.10.2 SP2
                  7.1.3 CE GA4
                  7.1.X
                  Master