Issue
When you create a Site based on a Site Template, change the default localization settings of a the created Site and take away from the available locales, further changes to the Site Template are not propagated to the Site.
Reproduction steps:
- Go to Control Panel → System Settings → Infrastructure → Site Settings Configuration, check "Enable custom language settings for sites with template propagation", and save it
- Create a dummy site template from Control Panel → Site Templates.('Dummy site template')
- Go to Control Panel → Sites and create a new one based upon the 'Dummy site template'. ('Dummy site')
- Go to the Site Settings page → Localization and activate the 'Define a custom default language and additional available languages for this site' option.
- Leave 'English (United States)' as the default language and 'English (United States)' and 'Finnish (Finland)' as current languages. Save.
- Add a new widget page to the 'Dummy site template' with the default values. ('Dummy page')
- Open the 'Dummy site' home page.
Result: changes are not propagated and an ERROR is thrown:
2023-02-20 12:37:10.972 ERROR [liferay/background_task-4][LayoutSetPrototypeImportBackgroundTaskExecutor:166] Merge fail count increased to 1 for layout set prototype 44335
com.liferay.portal.kernel.exception.LocaleException: null
at com.liferay.exportimport.internal.controller.LayoutImportController.validateFile(LayoutImportController.java:655) ~[?:?]
at com.liferay.exportimport.internal.controller.LayoutImportController.importDataDeletions(LayoutImportController.java:158) ~[?:?]
at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importLayoutsDataDeletions(ExportImportLocalServiceImpl.java:266) ~[portal-impl.jar:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50) ~[portal-impl.jar:?]
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69) ~[portal-impl.jar:?]
at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57) ~[portal-impl.jar:?]
at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49) ~[portal-impl.jar:?]
at com.sun.proxy.$Proxy125.importLayoutsDataDeletions(Unknown Source) ~[?:?]
at com.liferay.exportimport.internal.background.task.LayoutSetPrototypeImportBackgroundTaskExecutor$LayoutImportCallable.call(LayoutSetPrototypeImportBackgroundTaskExecutor.java:280) ~[?:?]
at com.liferay.exportimport.internal.background.task.LayoutSetPrototypeImportBackgroundTaskExecutor$LayoutImportCallable.call(LayoutSetPrototypeImportBackgroundTaskExecutor.java:266) ~[?:?]
at com.liferay.portal.spring.transaction.BaseTransactionExecutor.execute(BaseTransactionExecutor.java:37) ~[portal-impl.jar:?]
at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:39) ~[portal-impl.jar:?]
at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28) ~[portal-kernel.jar:?]
at com.liferay.exportimport.internal.background.task.LayoutSetPrototypeImportBackgroundTaskExecutor.execute(LayoutSetPrototypeImportBackgroundTaskExecutor.java:130) [bundleFile:?]
at com.liferay.portal.background.task.internal.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:63) [bundleFile:?]
at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:41) [portal-kernel.jar:?]
at com.liferay.portal.background.task.internal.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:72) [bundleFile:?]
at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:120) [bundleFile:?]
at com.liferay.portal.kernel.messaging.BaseMessageListener.doReceive(BaseMessageListener.java:48) [portal-kernel.jar:?]
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:34) [portal-kernel.jar:?]
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74) [portal-kernel.jar:?]
at com.liferay.portal.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:56) [bundleFile:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
2023-02-20 12:37:11.040 ERROR [liferay/background_task-4][BackgroundTaskMessageListener:167] Unable to execute background task
com.liferay.portal.kernel.exception.LocaleException: null
at com.liferay.exportimport.internal.controller.LayoutImportController.validateFile(LayoutImportController.java:655) ~[?:?]
at com.liferay.exportimport.internal.controller.LayoutImportController.importDataDeletions(LayoutImportController.java:158) ~[?:?]
at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importLayoutsDataDeletions(ExportImportLocalServiceImpl.java:266) ~[portal-impl.jar:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50) ~[portal-impl.jar:?]
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69) ~[portal-impl.jar:?]
at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57) ~[portal-impl.jar:?]
at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49) ~[portal-impl.jar:?]
at com.sun.proxy.$Proxy125.importLayoutsDataDeletions(Unknown Source) ~[?:?]
at com.liferay.exportimport.internal.background.task.LayoutSetPrototypeImportBackgroundTaskExecutor$LayoutImportCallable.call(LayoutSetPrototypeImportBackgroundTaskExecutor.java:280) ~[?:?]
at com.liferay.exportimport.internal.background.task.LayoutSetPrototypeImportBackgroundTaskExecutor$LayoutImportCallable.call(LayoutSetPrototypeImportBackgroundTaskExecutor.java:266) ~[?:?]
at com.liferay.portal.spring.transaction.BaseTransactionExecutor.execute(BaseTransactionExecutor.java:37) ~[portal-impl.jar:?]
at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:39) ~[portal-impl.jar:?]
at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28) ~[portal-kernel.jar:?]
at com.liferay.exportimport.internal.background.task.LayoutSetPrototypeImportBackgroundTaskExecutor.execute(LayoutSetPrototypeImportBackgroundTaskExecutor.java:130) ~[?:?]
at com.liferay.portal.background.task.internal.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:63) ~[?:?]
at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:41) ~[portal-kernel.jar:?]
at com.liferay.portal.background.task.internal.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:72) ~[bundleFile:?]
at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:120) [bundleFile:?]
at com.liferay.portal.kernel.messaging.BaseMessageListener.doReceive(BaseMessageListener.java:48) [portal-kernel.jar:?]
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:34) [portal-kernel.jar:?]
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74) [portal-kernel.jar:?]
at com.liferay.portal.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:56) [bundleFile:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
Environment
- Liferay DXP 7.4
Resolution
- The behavior you is a limitation of the "Enable custom language settings for sites with template propagation" configuration: it should not be possible to reduce the locales on the Site level compared to the system level.
- The locale list on Site level should be able to be extended only.
Additional Information
- There is a Feature Request ticket raised to disable the possibility of reducing locales on the Site level, if the Site is created from a Site Template: LPS-179885
Conteúdo Excluesivo para Assinantes
Uma Subscrição do Liferay Enterprise fornece acesso a mais de 1.500 artigos que incluem práticas recomendadas, solução de problemas e outras soluções valiosas. Faça login para obter acesso completo.
Entrar