Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
6.1.2 CE GA3, 6.2.10 EE GA1, 7.0.0 M3
-
6.2.x, 6.1.x
-
Committed
-
18
-
2
Description
When you upload a file into Web Content that exceeds dl.file.max.size, Liferay does not handle it gracefully like it does with Docs & Media. D&M will tell you that the file is too large, whereas Web Content will throw an error in the logs and just say "Web Content is temporarily unavailable" in the GUI.
Steps to Reproduce
1. Set dl.file.max.size=1 in your portal-ext.properties. You can also set this in Server Administration -> File Upload, but the properties is faster
2. Create a web content Structure with an Image field (see screenshot)
3. Create a Template that uses the Structure you created in Step 3. The template script can be blank.
4. Create a new web content by selecting the Structure.
5. In the image field, upload any image.
6. Click on Publish
ACTUAL: You'll see the errors described in the below section
EXPECTED: Liferay will gracefully tell you that your image exceeds the $DL-FileSize, just like it does for Docs & Media.
I think this is a bug because Liferay handles this in Docs &Media by telling you that you've exceeded the set Max size, but it doesn't in web content. This behavior should be consistent.
Errors
GUI error - Web Content is temporarily unavailable
Log error:
18:08:43,277 ERROR [http-bio-8080-exec-5][render_portlet_jsp:154] com.liferay.portlet.documentlibrary.FileSizeException: 10441.jpg at com.liferay.portlet.documentlibrary.store.DLStoreImpl.validate(DLStoreImpl.java:571) at com.liferay.portlet.documentlibrary.store.DLStoreImpl.addFile(DLStoreImpl.java:80) at com.liferay.portlet.documentlibrary.store.DLStoreUtil.addFile(DLStoreUtil.java:101) at com.liferay.portal.image.DLHook.updateImage(DLHook.java:85) at com.liferay.portal.service.impl.ImageLocalServiceImpl.updateImage(ImageLocalServiceImpl.java:302) at com.liferay.portal.service.impl.ImageLocalServiceImpl.updateImage(ImageLocalServiceImpl.java:278) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.security.pacl.PACLAdvice.invoke(PACLAdvice.java:51) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
Testing
Reproduced on 6.1.x dedd2f0f8892ff7e8851238dce1172270500e7c4
Reproduced on Master afc8c21b2c24c505625f24705bd88ec3396d11ca
Attachments
Issue Links
- relates
-
LPS-50970 In 6.2.x we do not use the textFormatter and have not changed the language key for fileMaxSize exceptions.
- Closed
-
LPE-12807 Uploading images to Web Content that exceed the DL file size throws errors instead of showing a warning message that the file is too large
-
- Closed
-
- Testing discovered
-
LPS-50375 Web Content can not edit when using Structure
- Closed