-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: Master
-
Fix Version/s: 7.0.0 DXP FP26, 7.0.X EE, 7.0.4 CE GA5, 7.1.X, Master
-
Component/s: Message Boards, Staging
-
Branch Version/s:7.0.x
-
Backported to Branch:Committed
-
Story Points:1.5
-
Fix Priority:3
-
Git Pull Request:
Add the following code snippet to BaseStagedModelDataHandlerTestCase and run the MBMessageStagedModelDataHandlerTest.
@Test public void testDoubleExportImport() throws Exception { Map<String, List<StagedModel>> dependentStagedModelsMap = addDependentStagedModelsMap(stagingGroup); StagedModel stagedModel = addStagedModel( stagingGroup, dependentStagedModelsMap); exportImportStagedModel(stagedModel); StagedModel importedStagedModel = getStagedModel( stagedModel.getUuid(), liveGroup); Assert.assertNotNull(importedStagedModel); exportImportStagedModel(stagedModel); importedStagedModel = getStagedModel(stagedModel.getUuid(), liveGroup); Assert.assertNotNull(importedStagedModel); }
The problem is when the message has an attachment and we import the same lar with this message two times to the same destination, the import fails with this exception:
com.liferay.exportimport.kernel.lar.PortletDataException: com.liferay.document.library.kernel.exception.DuplicateFileEntryException: attachment.txt at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:421) at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:433)