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

Unable to export web content display when selected template has been removed

    Details

      Description

      Steps to reproduce it:

      1. Create a web content structure.
      2. Create a template A for that structure.
      3. Create a web content using that structure and template.
      4. Add a Web Content Display portlet and configure it selecting the previous web content and template.
      5. Create a new template B.
      6. Create a new version for the previous web content and select the template B.
      7. Remove the first version of the web content.
      8. Delete template A.
      9. Go to the previous web content display and export it.

      Results: The process will fail and you will get the following exception:

      11:29:50,845 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:156] Unable to execute background task
      com.liferay.portlet.exportimport.lar.PortletDataException: Unable to export referenced article template
      	at com.liferay.journal.content.web.exportimport.portlet.preferences.processor.JournalContentExportImportPortletPreferencesProcessor.processExportPortletPreferences(JournalContentExportImportPortletPreferencesProcessor.java:170)
      	at com.liferay.exportimport.controller.PortletExportController.exportPortletPreference(PortletExportController.java:936)
      	at com.liferay.exportimport.controller.PortletExportController.exportPortletPreferences(PortletExportController.java:1027)
      	at com.liferay.exportimport.controller.PortletExportController.exportPortlet(PortletExportController.java:750)
      	at com.liferay.exportimport.controller.PortletExportController.doExport(PortletExportController.java:430)
      	at com.liferay.exportimport.controller.PortletExportController.export(PortletExportController.java:148)
      	at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.exportPortletInfoAsFile(ExportImportLocalServiceImpl.java:121)
      	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:153)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:84)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.RetryAdvice.invoke(RetryAdvice.java:46)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:38)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173)
      	at com.sun.proxy.$Proxy84.exportPortletInfoAsFile(Unknown Source)
      	at com.liferay.portlet.exportimport.service.ExportImportLocalServiceUtil.exportPortletInfoAsFile(ExportImportLocalServiceUtil.java:68)
      	at com.liferay.exportimport.background.task.PortletExportBackgroundTaskExecutor.execute(PortletExportBackgroundTaskExecutor.java:71)
      	at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:43)
      	at com.liferay.portal.kernel.backgroundtask.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:56)
      	at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:121)
      	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:52)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: com.liferay.dynamic.data.mapping.exception.NoSuchTemplateException: No DDMTemplate exists with the template key 20841 in the ancestor groups
      	at com.liferay.dynamic.data.mapping.service.impl.DDMTemplateLocalServiceImpl.getTemplate(DDMTemplateLocalServiceImpl.java:637)
      	at sun.reflect.GeneratedMethodAccessor1267.invoke(Unknown Source)
      	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:153)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:84)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173)
      	at com.sun.proxy.$Proxy421.getTemplate(Unknown Source)
      	at com.liferay.journal.content.web.exportimport.portlet.preferences.processor.JournalContentExportImportPortletPreferencesProcessor.processExportPortletPreferences(JournalContentExportImportPortletPreferencesProcessor.java:160)
      	... 49 more
      

      Expected result: The export process shouldn't fail since we have removed the template properly. I think we should export the content with the current template if the selected one does not exist (as we do to show the content in the portlet).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lu.liu Lu Liu
              Reporter:
              alberto.chaparro Alberto Chaparro
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 18 weeks, 1 day ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 Beta 3