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

Can not add multiple blog entries use the same image

    Details

      Description

      Step to reproduce:

      1. Site admin > Content & Data > Blogs > Entries tab
      2. Click plus icon button
      3. Select File > Blog Images tab > Select File
      4. Upload an image
      5. Type title and content
      6. Publish
      7. Click plus icon button
      8. Select File > Blog Images tab
      9. Click previous image card
      10. Type title and content
      11. Publish

      Expected Results:
      The second blog entry should be shown in Blogs admin.

      Actual Results:
      The second blog entry is not shown. And the following error is thrown in console.

      2020-04-10 05:27:29.915 ERROR [http-nio-8080-exec-7][EditEntryMVCActionCommand:257] com.liferay.portal.kernel.exception.PortalException: Unable to get a unique file name for Apeach.png
      com.liferay.portal.kernel.exception.PortalException: Unable to get a unique file name for Apeach.png
              at com.liferay.upload.web.internal.DefaultUniqueFileNameProvider.provide(DefaultUniqueFileNameProvider.java:48)
              at com.liferay.blogs.service.impl.BlogsEntryLocalServiceImpl._getUniqueFileName(BlogsEntryLocalServiceImpl.java:1753)
              at com.liferay.blogs.service.impl.BlogsEntryLocalServiceImpl._addProcessedImageFileEntry(BlogsEntryLocalServiceImpl.java:1616)
              at com.liferay.blogs.service.impl.BlogsEntryLocalServiceImpl._addCoverImageFileEntry(BlogsEntryLocalServiceImpl.java:1570)
              at com.liferay.blogs.service.impl.BlogsEntryLocalServiceImpl.addEntry(BlogsEntryLocalServiceImpl.java:367)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
              at com.sun.proxy.$Proxy630.addEntry(Unknown Source)
              at com.liferay.blogs.service.BlogsEntryLocalServiceWrapper.addEntry(BlogsEntryLocalServiceWrapper.java:151)
              at com.liferay.blogs.reading.time.internal.service.BlogsReadingTimeEntryLocalServiceWrapper.addEntry(BlogsReadingTimeEntryLocalServiceWrapper.java:59)
      

      Reproduced on:
      Tomcat 9.0.33 + MySQL 5.7. Portal master GIT ID: b48f1db31351d462184cbc4c49b4f7fabfc09cd3.
      Tomcat 9.0.33 + MySQL 5.7. Portal 7.3.1-CE-GA2.
      Tomcat 9.0.33 + MySQL 5.7. Portal 7.2.x-private GIT ID: 964393363e2f48b0c4d95a05352ddf65a32dc544.

      Cannot be reproduced on:
      Tomcat 9.0.17 + MySQL 5.7. Portal 7.3.0-CE-GA1.
      Tomcat 9.0.17 + MySQL 5.7. Portal 7.2.10-DXP-4.
      Tomcat 9.0.33 + MySQL 5.7. Portal 7.1.x-private GIT ID: 26e946b6da654c0088fed9a66dfddd889603a0e9.
      Tomcat 8.0.53 + MySQL 5.7. Portal 7.0.x-private GIT ID: 391618d5bc7f03211fa92e8dcdedd5bc4ea62265.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yang.cao Yang Cao
              Reporter:
              yang.cao Yang Cao
              Participants of an Issue:
              Recent user:
              Jason Pince
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                27 weeks, 1 day ago

                  Packages

                  Version Package
                  7.1.10 DXP FP18
                  7.1.X
                  7.2.10 DXP FP5
                  7.2.10.2 DXP SP2
                  7.2.X
                  7.3.10 DXP GA1
                  Master