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

MBMessage import fails if we repeat it two times for the same entity

    Details

      Description

      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)

        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, 17 weeks, 2 days ago

                Packages

                Version Package
                7.0.0 DXP FP26
                7.0.X EE
                7.0.4 CE GA5
                7.1.X
                Master