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

Importing a LAR in 6.0 fails because of "DuplicateImageNameException" when it contains images with same name, different extension



      In Liferay 6.0, IG allows to have files with same name but different extension in a given folder. However, when creating a LAR from IG data, it can't be imported into a new community due to a DuplicateImageNameException

      Steps to reproduce:
      1. Prepare 3 image files with same name and different extension: jpg, png and tiff (note: it's enough to copy the same image and change the extension. Actual file format does not matter)
      2. Create a new community c1
      3. From control panel, go to Image Gallery for c1 scope and create folder f1
      4. Upload the 3 images into f1. Please note how the name remains the same for them
      5. Add a page to c1 (just to allow export)
      6. Create a LAR from the IG Export/Import option available from the wrench icon in the control panel
      7. Create a new community c2, add a page to c2
      8. Select c2 as the scope in the control panel.
      9. Go to Image Gallery and import the LAR created in step 6

      Observed behavior:

      • LAR is not imported, a DuplicateImageNameException is shown in the log

      Expected behavior:

      • LAR is imported. The 3 images are in f1 either with the same name or with a number acting as suffix (img-1, img-2 and img-3)


          Issue Links



              hong.zhao Hong Zhao (Inactive)
              daniel.sanz Daniel Sanz
              Participants of an Issue:
              Recent user:
              Esther Sanz
              0 Vote for this issue
              1 Start watching this issue


                Days since last comment:
                7 years, 7 weeks, 2 days ago


                  Version Package
                  6.0.X EE