[
https://issues.apache.org/jira/browse/OFBIZ-10833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16767155#comment-16767155 ]
Swapnil M Mane commented on OFBIZ-10833:
----------------------------------------
Hello team,
It seems there is an issue at the framework level.
When the form of enctype="multipart/form-data" type is submitted, the parameters are not available to the next response type.
Here is the example (taking reference of the issue reported here 'CMS add content not working')
{code}
<request-map uri="createTextContentCms">
<security https="true" auth="true"/>
<event type="service" invoke="createTextContent"/>
<response name="success" type="view" value="WebSiteCMS"/>
<response name="error" type="view" value="WebSiteCMS"/>
</request-map>
{code}
The parameters provided to createTextContent service are not available to WebSiteCMS view.
As per my exploration, here is a possible reason for this.
UtilHttp.getMultiPartParameterMap method is used to get the parameters in case of "multipart/form-data" type.
The getMultiPartParameterMap parse the request to get the parameters.
(trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java)
{code}
uploadedItems = UtilGenerics.<FileItem>checkList(upload.parseRequest(request));
{code}
As per the Apache commons-fileupload guideline, a request can only be parsed once [1]. So, for the next response (WebSiteCMS view), again the same getMultiPartParameterMap method is executed (with the same request object), and no parameters are found, since, the request is already parsed.
Also, have a look at the StackOverflow question [2], it also contains related information.
[1]
http://commons.apache.org/proper/commons-fileupload/faq.html#empty-parse[2]
https://stackoverflow.com/questions/13881272/servletfileuploadparserequestrequest-returns-an-empty-listPlease feel free to share your thoughts!
Thanks!
> CMS add content not working
> ---------------------------
>
> Key: OFBIZ-10833
> URL:
https://issues.apache.org/jira/browse/OFBIZ-10833> Project: OFBiz
> Issue Type: Bug
> Components: content
> Affects Versions: Trunk, 17.12.01
> Reporter: Ingo Wolfmayr
> Assignee: Swapnil M Mane
> Priority: Major
>
> On demo: content --> "CmsSite" --> CMS:
> Right click on one of the items to add "New Long Text" or "Image".
> After saving the new content:
> Edit WebSite CMS For: []
> "There is no Content PUBLISH_POINT for this WebSite!"
> Having the same problem on a 17.12 local installation.
> h1.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)