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

Document URL without parameters in Paragraph component fails while publishing

    Details

      Description

      Issue
      Document/Image URL without parameters in Paragraph component fails when Publishing to Live

      Steps to Reproduce

      1. Start the server and login
      2. Create a site, enable staging with default options
      3. In the Site, add a sample image to Documents and Media
      Copy the image URL to your clipboard
      (example: http://localhost:8080/documents/35523/0/abc.png/899f9d18-217a-951f-b00f-774fb21999d6)
      4. Create a Content Page and add a Paragraph component.

      • Select the Paragraph component for editing
      • Highlight some of the default text and use the 'link' icon from the formatting options to link the image uploaded in step 3.
      • Paste in the image URL

      Checkpoint - test the link to make sure the image is accessible.

      6. Publish the Content Page
      7. Click Publish to Live

      Expected Behaviour
      The Content Page is published and the link to image works.

      Actual Behaviour
      On publication we observe the following sample error:

      An unexpected error occurred with the publication process. Please check your portal and publishing configuration.
      The model.resource.com.liferay.fragment.model.FragmentEntryLink 5c48464f-ee32-ffb5-44e6-729e099f9b52 could not be exported because of the following error: org.json.JSONException: Expected a ',' or '}' at 526 [character 527 line 1].
      

      The log shows:

      2021-02-10 07:55:00.130 ERROR [http-nio-8080-exec-10][JDBCExceptionReporter:234] integrity constraint violation: unique constraint or index violation: IX_C7057FF7
      2021-02-10 07:55:00.133 ERROR [http-nio-8080-exec-10][JDBCExceptionReporter:234] integrity constraint violation: unique constraint or index violation: IX_C7057FF7
      2021-02-10 07:57:46.387 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:177] Unable to execute background task
      com.liferay.exportimport.kernel.lar.PortletDataException: org.json.JSONException: Expected a ',' or '}' at 526 [character 527 line 1]
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:149)
      	at com.liferay.exportimport.data.handler.base.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:80)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:180)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.exportReferenceStagedModel(StagedModelDataHandlerUtil.java:156)
      	at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler._exportLayoutPageTemplateStructure(LayoutStagedModelDataHandler.java:2134)
      	at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doExportStagedModel(LayoutStagedModelDataHandler.java:385)
      	at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doExportStagedModel(LayoutStagedModelDataHandler.java:139)
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:102)
      	at com.liferay.exportimport.data.handler.base.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:80)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:180)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.exportReferenceStagedModel(StagedModelDataHandlerUtil.java:156)
      	at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doExportStagedModel(LayoutStagedModelDataHandler.java:350)
      	at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doExportStagedModel(LayoutStagedModelDataHandler.java:139)
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:102)
      	at com.liferay.exportimport.data.handler.base.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:80)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:180)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.exportReferenceStagedModel(StagedModelDataHandlerUtil.java:156)
      	at com.liferay.layout.internal.exportimport.data.handler.StagedLayoutSetStagedModelDataHandler.exportLayouts(StagedLayoutSetStagedModelDataHandler.java:437)
      	at com.liferay.layout.internal.exportimport.data.handler.StagedLayoutSetStagedModelDataHandler.doExportStagedModel(StagedLayoutSetStagedModelDataHandler.java:230)
      	at com.liferay.layout.internal.exportimport.data.handler.StagedLayoutSetStagedModelDataHandler.doExportStagedModel(StagedLayoutSetStagedModelDataHandler.java:88)
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:102)
      	at com.liferay.exportimport.data.handler.base.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:80)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:180)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.exportReferenceStagedModel(StagedModelDataHandlerUtil.java:156)
      	at com.liferay.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.doExportStagedModel(StagedGroupStagedModelDataHandler.java:242)
      	at com.liferay.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.doExportStagedModel(StagedGroupStagedModelDataHandler.java:78)
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:102)
      	at com.liferay.exportimport.data.handler.base.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:80)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:180)
      	at com.liferay.exportimport.internal.controller.LayoutExportController.doExport(LayoutExportController.java:327)
      	at com.liferay.exportimport.internal.controller.LayoutExportController.export(LayoutExportController.java:119)
      	at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.exportLayoutsAsFile(ExportImportLocalServiceImpl.java:65)
      	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.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69)
      	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
      	at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
      	at com.sun.proxy.$Proxy146.exportLayoutsAsFile(Unknown Source)
      	at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.exportLayoutsAsFile(ExportImportLocalServiceUtil.java:43)
      	at com.liferay.exportimport.internal.background.task.LayoutStagingBackgroundTaskExecutor.execute(LayoutStagingBackgroundTaskExecutor.java:139)
      	at com.liferay.portal.background.task.internal.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:62)
      	at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:41)
      	at com.liferay.portal.background.task.internal.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:72)
      	at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:131)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
      	at com.liferay.portal.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:56)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:753)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:665)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: com.liferay.portal.kernel.json.JSONException: org.json.JSONException: Expected a ',' or '}' at 526 [character 527 line 1]
      	at com.liferay.portal.json.JSONObjectImpl.<init>(JSONObjectImpl.java:83)
      	at com.liferay.portal.json.JSONFactoryImpl.createJSONObject(JSONFactoryImpl.java:173)
      	at com.liferay.portal.kernel.json.JSONFactoryUtil.createJSONObject(JSONFactoryUtil.java:75)
      	at com.liferay.fragment.internal.exportimport.content.processor.FragmentEntryLinkExportImportContentProcessor.replaceExportContentReferences(FragmentEntryLinkExportImportContentProcessor.java:115)
      	at com.liferay.fragment.internal.exportimport.content.processor.FragmentEntryLinkExportImportContentProcessor.replaceExportContentReferences(FragmentEntryLinkExportImportContentProcessor.java:66)
      	at com.liferay.fragment.internal.exportimport.data.handler.FragmentEntryLinkStagedModelDataHandler.doExportStagedModel(FragmentEntryLinkStagedModelDataHandler.java:93)
      	at com.liferay.fragment.internal.exportimport.data.handler.FragmentEntryLinkStagedModelDataHandler.doExportStagedModel(FragmentEntryLinkStagedModelDataHandler.java:43)
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:102)
      	... 52 more
      Caused by: org.json.JSONException: Expected a ',' or '}' at 526 [character 527 line 1]
      	at org.json.JSONTokener.syntaxError(JSONTokener.java:505)
      	at org.json.JSONObject.<init>(JSONObject.java:264)
      	at org.json.JSONTokener.nextValue(JSONTokener.java:431)
      	at org.json.JSONObject.<init>(JSONObject.java:245)
      	at org.json.JSONTokener.nextValue(JSONTokener.java:431)
      	at org.json.JSONObject.<init>(JSONObject.java:245)
      	at org.json.JSONTokener.nextValue(JSONTokener.java:431)
      	at org.json.JSONObject.<init>(JSONObject.java:245)
      	at org.json.JSONObject.<init>(JSONObject.java:399)
      	at com.liferay.portal.json.JSONObjectImpl.<init>(JSONObjectImpl.java:80)
      	... 59 more
      
      

      Please also see the attached movie file supplied by the client.

      Additional
      Note the difference in URL if we use the browse to file option instead of pasting our link:
      /documents/34641/0/homer3.png/d8140f0a-2a4e-7236-932b-1577875665aa?t=1612946600698&download=true

      This approach allows for the Content Page to be successfully Published to Live and the image accessible via the link.

      Reproduced in
      DXP 7.2 + dxp-10
      7.2.x (8c745c6e9d2835351b02cabb7322c10503d466ad)
      Master (bb07e86043745b02f578135940c402e8405b8762)

       

        Attachments

          Activity

            People

            Assignee:
            joyce.wang Joyce Wang
            Reporter:
            il.kim Brian I. Kim
            Participants of an Issue:
            Recent user:
            Sophia Zhang
            Engineering Assignee:
            Brian I. Kim
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

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

                Packages

                Version Package
                7.2.10 DXP FP12
                7.2.X
                7.3.X
                7.3.6 CE GA7
                7.3.7 CE GA8
                7.4.0 CE GA1
                Master