Affects Version/s: 7.0.X
Component/s: Staging > Export/Import
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
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:
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
catches and handles. LPS-77336
Steps to demonstrate Exception throw in master with debugger:
- Startup Liferay with these properties defined in portal-ext.properties
- Create a France site and set the default language to English (UK) (site > configuration > site settings > languages)
- Create a new site UK on the same instance and set default language to English (UK)
- From the UK Site, create a Dynamic Data List and when selecting a Data Definition, make a new Data Definition
- Export the Dynamic Data List from the top right of the Dynamic Data Lists portlet as "Export 1"
- 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
- Export the Dynamic Data List again as "Export 2"
- Go to the France Site and import "Export 1" into the Dynamic Data Lists module
- Change the France site default language to French
- Begin the import process of "Export 2" in the Dynamic Data Lists module, but don't click Import
- Go to your IDE and put a break point on DDLRecordSetLocalServiceImpl.validateName(Map<Locale, String> nameMap) on the first line of
- Place another break point on StagedModelDataHandlerUtil.doImportReferenceStagedModel() on the first line in the catch of
- Click Import
- 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.
The update of the DDLRecordSet using the RecordSet's old nameMap will not throw an exception.