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

Default value entry at JournalArticle table is not deleted when deleting its DDMStructure

    Details

      Description

      Default value entry at JournalArticle table is not deleted when deleting its DDMStructure.

      Steps to Reproduce

      1. Create a DDMStructure
      2. Open "Edit default values" option and add some default values
      3. Check DDMStructure and JournalArticle tables, you will see a new record in each table
      4. Delete the DDMStructure
      5. Check DDMStructure and JournalArticle tables again:
        • Wrong behavior: Only DDMStructure record is deleted
        • Expected behavior: Both created records are deleted

      This causes some side effects at LAR exports, this functionality stops working if you have another DDMStructure
      Additional Steps to Reproduce

      1. Execute previous steps
      2. Create other DDMStructure, in order to trigger default values export
      3. Execute a LAR export of all WCM objects.
        • Wrong behavior: Following exception is thrown
          12:06:31,252 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:133] Unable to execute background task
          com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portlet.dynamicdatamapping.NoSuchStructureException: No DDMStructure exists with the key {groupId=10194, classNameId=10109, structureKey=191268}
                  at com.liferay.portal.lar.backgroundtask.PortletStagingBackgroundTaskExecutor.execute(PortletStagingBackgroundTaskExecutor.java:68)
                  at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56)
                  at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:108)
                  at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
                  at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
                  at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
                  at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
                  at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
                  at java.lang.Thread.run(Thread.java:744)
          Caused by: com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portlet.dynamicdatamapping.NoSuchStructureException: No DDMStructure exists with the key {groupId=10194, classNameId=10109, structureKey=191268}
                  at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:82)
                  at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:173)
                  at com.liferay.portlet.journal.service.persistence.JournalArticleExportActionableDynamicQuery.performAction(JournalArticleExportActionableDynamicQuery.java:128)
                  at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActionsInSingleInterval(BaseActionableDynamicQuery.java:324)
                  at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActions(BaseActionableDynamicQuery.java:46)
                  at com.liferay.portlet.journal.lar.JournalPortletDataHandler.doExportData(JournalPortletDataHandler.java:205)
                  at com.liferay.portal.kernel.lar.BasePortletDataHandler.exportData(BasePortletDataHandler.java:108)
                  at com.liferay.portal.lar.PortletExporter.exportPortletData(PortletExporter.java:227)
                  at com.liferay.portal.lar.PortletExporter.exportPortlet(PortletExporter.java:1034)
                  at com.liferay.portal.lar.PortletExporter.doExportPortletInfoAsFile(PortletExporter.java:446)
                  at com.liferay.portal.lar.PortletExporter.exportPortletInfoAsFile(PortletExporter.java:297)
                  at com.liferay.portal.service.impl.LayoutLocalServiceImpl.exportPortletInfoAsFile(LayoutLocalServiceImpl.java:998)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:606)
                  at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
                  at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:183)
                  at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
                  at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:141)
                  at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
                  at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
                  at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
                  at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
                  at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
                  at com.sun.proxy.$Proxy34.exportPortletInfoAsFile(Unknown Source)
                  at com.liferay.portal.service.LayoutLocalServiceUtil.exportPortletInfoAsFile(LayoutLocalServiceUtil.java:788)
                  at com.liferay.portal.lar.backgroundtask.PortletStagingBackgroundTaskExecutor$PortletStagingCallable.call(PortletStagingBackgroundTaskExecutor.java:110)
                  at com.liferay.portal.lar.backgroundtask.PortletStagingBackgroundTaskExecutor$PortletStagingCallable.call(PortletStagingBackgroundTaskExecutor.java:1)
                  at com.liferay.portal.spring.transaction.TransactionalCallableUtil$CallableMethodInvocation.proceed(TransactionalCallableUtil.java:84)
                  at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
                  at com.liferay.portal.spring.transaction.TransactionalCallableUtil.call(TransactionalCallableUtil.java:36)
                  at com.liferay.portal.lar.backgroundtask.PortletStagingBackgroundTaskExecutor.execute(PortletStagingBackgroundTaskExecutor.java:56)
                  ... 8 more
          Caused by: com.liferay.portlet.dynamicdatamapping.NoSuchStructureException: No DDMStructure exists with the key {groupId=10194, classNameId=10109, structureKey=191268}
                  at com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistenceImpl.findByG_C_S(DDMStructurePersistenceImpl.java:7245)
                  at com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureLocalServiceImpl.getStructure(DDMStructureLocalServiceImpl.java:809)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:606)
                  at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
                  at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
                  at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
                  at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
                  at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
                  at com.sun.proxy.$Proxy215.getStructure(Unknown Source)
                  at com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil.getStructure(DDMStructureLocalServiceUtil.java:1001)
                  at com.liferay.portlet.journal.lar.JournalArticleStagedModelDataHandler.doExportStagedModel(JournalArticleStagedModelDataHandler.java:281)
                  at com.liferay.portlet.journal.lar.JournalArticleStagedModelDataHandler.doExportStagedModel(JournalArticleStagedModelDataHandler.java:1)
                  at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:69)
                  ... 40 more
          
        • Expected behavior: No error is thrown and LAR export is executed sucessfully

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mark.jin Mark Jin (Inactive)
                Reporter:
                jorge.diaz Jorge Diaz
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 36 weeks, 4 days ago

                  Packages

                  Version Package
                  6.2.4 CE GA5
                  6.2.X EE
                  7.0.0 Alpha 1