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

Publishing an asset that depends on an asset deleted from production may cause errors

    Details

      Description

      Steps to reproduce:

      1. Create a WC structure
      2. Enable Publications
      3. Create new publication
      4. Create a WC template based off of the WC structure from (1)
      5. Work on production
      6. Delete the WC structure from (1)
      7. Publish publication from (3)

      Expected Result: User isn't allowed to publish the publication since it depends on WC structure that doesn't exist

      Actual Result: Publish happens successfully, but an error is thrown when attempting to view the template

      ERROR [http-nio-8080-exec-3][IncludeTag:128] Current URL /group/guest/~/control_panel/manage?p_p_id=com_liferay_journal_web_portlet_JournalPortlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_com_liferay_journal_web_portlet_JournalPortlet_mvcPath=%2Fedit_ddm_template.jsp&_com_liferay_journal_web_portlet_JournalPortlet_redirect=%2Fgroup%2Fguest%2F~%2Fcontrol_panel%2Fmanage%3Fp_p_id%3Dcom_liferay_journal_web_portlet_JournalPortlet%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_com_liferay_journal_web_portlet_JournalPortlet_mvcPath%3D%252Fview_ddm_templates.jsp%26p_p_auth%3DbR7Nellx&_com_liferay_journal_web_portlet_JournalPortlet_ddmTemplateId=39094&p_p_auth=bR7Nellx generates exception: com.liferay.dynamic.data.mapping.exception.NoSuchStructureException: No DDMStructure exists with the primary key 39089
      com.liferay.dynamic.data.mapping.exception.NoSuchStructureException: No DDMStructure exists with the primary key 39089
      	at com.liferay.dynamic.data.mapping.service.persistence.impl.DDMStructurePersistenceImpl.findByPrimaryKey(DDMStructurePersistenceImpl.java:10675)
      	at com.liferay.dynamic.data.mapping.service.persistence.impl.DDMStructurePersistenceImpl.findByPrimaryKey(DDMStructurePersistenceImpl.java:10693)
      	at com.liferay.dynamic.data.mapping.service.impl.DDMStructureLocalServiceImpl.getStructure(DDMStructureLocalServiceImpl.java:770)
      	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.liferay.dynamic.data.mapping.service.DDMStructureLocalServiceUtil.getStructure(DDMStructureLocalServiceUtil.java:735)
      	at com.liferay.dynamic.data.mapping.template.BaseDDMTemplateHandler.getStructureFieldsTemplateVariableGroup(BaseDDMTemplateHandler.java:137)
      	at com.liferay.dynamic.data.mapping.template.BaseDDMTemplateHandler.getTemplateVariableGroups(BaseDDMTemplateHandler.java:56)
      	at com.liferay.journal.web.internal.portlet.template.JournalTemplateHandler.getTemplateVariableGroups(JournalTemplateHandler.java:104)
      	at com.liferay.portal.template.TemplateContextHelper.getTemplateVariableGroups(TemplateContextHelper.java:140)
      	at com.liferay.journal.web.internal.display.context.JournalEditDDMTemplateDisplayContext.getTemplateVariableGroups(JournalEditDDMTemplateDisplayContext.java:325)
      	at org.apache.jsp.edit_005fddm_005ftemplate_005fdisplay_jsp._jspService(edit_005fddm_005ftemplate_005fdisplay_jsp.java:527)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
      	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
      	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
      	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)

      Alternate steps:

      • A user creates a Publication with a WC article that requires a template production. Then the user deletes the template in production. The publication publishes successfully, but the WC published has no default template - change happened without user input.
      • A user adds a widget to a widget page (that already exists in production). Then the user deletes the widget page in production. User is then unable to navigate home (error page shows instead) while in the publication due to the following error.
        java.lang.IllegalArgumentException: Someone may be trying to circumvent the permission checker: {companyId=20097, name=com.liferay.portal.kernel.model.Layout, primKey=17, scope=4}

      An example of a potential solution:

      • When a user tries to publish a new portlet on a widget page that no longer exists on production, there's a Deletion Modification Conflict: Modification conflicts with a deletion on the review page and publishing isn't possible without fixing the conflict.

      Tested on:
      Tomcat 9.0.37 + MySQL 5.7
      Portal master SHA: c379f2a0f2204cf2ded7688e367ef69d72919485

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brooke.dalton Brooke Dalton
              Reporter:
              brian.lee Brian Lee
              Participants of an Issue:
              Recent user:
              Enterprise Release HU
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                2 weeks ago

                  Packages

                  Version Package
                  7.3.X
                  7.3.5 CE GA6
                  7.3.10 DXP GA1
                  Master