Description:
Removing an assigned Site Map Application Display Template causes NPE during LAR import of Public Pages.
NullPointerException stops import of Public Pages when you associate a Site Map portlet with an application display template(ADT), remove the ADT, export site pages to a LAR file, and try to import the LAR file.
62x Unique Fix
This is a 62x unique fix. This issue is not reproducible in master, which was resolved by LPS-52246.
There is a partial backport of LPS-52246 in 62x, which resolved the issue for LPS-52246.
The other commits, were not backported, since they were considered risky:
https://github.com/dustinryerson/liferay-portal-ee/pull/1090
The other commits would resolve the current issue, but will not be backported.
To prevent possible new behaviors from being introduced, especially since this involves staging, we will instead create a unique fix to resolve this issue.
Steps to reproduce:
1. Create an application display template for a site map portlet in the global scope
2. Create a new site and then add a page
3. Go to the page and add the site map portlet
4. Go into the configuration and change the default template to the ADT that was just added
5. Delete the newly added ADT from the global scope
6. Export the site pages of the new site that was just created into a LAR file
7. Create a new site and import this exported LAR file
Results of Testing:
Actual Result: NullPointerException when importing the LAR file
Expected Result: LAR file should import with the default template or the associated template if it exists
Error Log:
22:10:17,457 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:133] Unable to execute background task com.liferay.portal.kernel.lar.PortletDataException: java.lang.NullPointerException at com.liferay.portal.kernel.lar.BasePortletDataHandler.processImportPortletPreferences(BasePortletDataHandler.java:599) at com.liferay.portal.lar.PortletImporter.importPortletPreferences(PortletImporter.java:1173) at com.liferay.portal.lar.LayoutImporter.doImportLayouts(LayoutImporter.java:778) at com.liferay.portal.lar.LayoutImporter.importLayouts(LayoutImporter.java:249) at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importLayouts(LayoutLocalServiceImpl.java:1763) at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importLayouts(LayoutLocalServiceImpl.java:1812) 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.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115) at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:182) 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.$Proxy36.importLayouts(Unknown Source) at com.liferay.portal.service.LayoutLocalServiceUtil.importLayouts(LayoutLocalServiceUtil.java:1308) at com.liferay.portal.lar.backgroundtask.LayoutImportBackgroundTaskExecutor.execute(LayoutImportBackgroundTaskExecutor.java:61) at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:57) 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:745) Caused by: java.lang.NullPointerException at com.liferay.portal.kernel.lar.BasePortletDataHandler.processImportPortletPreferences(BasePortletDataHandler.java:487) ... 29 more
- fixes
-
LPS-66602 NPE in a site created based on a site template with propagation of changes when a manual asset publisher is configured with a non-existent global ADT
- Closed