[MAGNOLIA-8902] MultipartRequestFilter sets filesCountMax to 10 by default and only 9 fields are enabled to be sent Created: 18/May/23 Updated: 01/Jun/23 Resolved: 23/May/23 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 6.2.34 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | High |
| Reporter: | Francisco J. Giner | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: | |||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Description |
Steps to reproduce
Expected resultsForm is sent correctly and you can use the information of the request to do some logic. Actual resultsMultipartRequestFilter throws an exception because it can't handle 10 or more fields, but this should only be for "file" type fields and it is counting also text, checkbox, select, etc... fields. WorkaroundIncrease to a big number the value of the property "fileCountMax" for MultipartRequestFilter filter at the configuration in /server/filters/multipartRequest/. For example: fileCountMax: 100 Development notesSince in Magnolia 6.2.30 changed to commons-fileupload 1.5.0, this library "allows" to set a max of files you can upload in a request, but this library is not checking only files in the request. Is checking ALL the fields (files or not) in the request. You can check it in this commit from the github library: https://github.com/apache/commons-fileupload/commit/e20c04990f7420ca917e96a84cec58b13a1b3d17#commitcomment-113912200 |
| Comments |
| Comment by Francisco J. Giner [ 18/May/23 ] |
|
Exception throwed: ERROR info.magnolia.cms.filters.MultipartRequestFilter : Could not upload files:attachment org.apache.commons.fileupload.FileCountLimitExceededException: attachment at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367) ~[commons-fileupload-1.5.jar:1.5] |
| Comment by Francisco J. Giner [ 18/May/23 ] |
|
Sorry, title is in Spanish. |
| Comment by Francisco J. Giner [ 22/May/23 ] |
|
Confirmed by the developer who made this change in the "commons-fileupload" library: In the Magnolia code you have defined this variable with a value of 10 by default, thinking that it only affected files, but no, it affects the total number of fields that are sent in the form. So, every form that have 10 or more fields, fails. |
| Comment by Richard Gange [ 23/May/23 ] |
|
This issue duplicates |