[ofbiz-framework] branch release18.12 updated: Fixed: Error removing an uploaded party content

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch release18.12 updated: Fixed: Error removing an uploaded party content

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release18.12 by this push:
     new b2614b5  Fixed: Error removing an uploaded party content
b2614b5 is described below

commit b2614b5ddf7cdfaabaa99b8bedcc3cc7ae018fb1
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Fri Apr 17 17:19:08 2020 +0200

    Fixed: Error removing an uploaded party content
   
    (OFBIZ-11597)
   
    When you try to remove an uploaded party content you get this error:
   
    ControlServlet                |E| Error in request handler:
    org.apache.ofbiz.webapp.control.RequestHandlerException:
    Unknown request [removePartyContent/viewprofile];
    this request does not exist or cannot be called directly.
   
    While at it I also fixed the similar case for payment methods
---
 applications/party/template/party/profileblocks/ContentList.ftl    | 4 ++--
 applications/party/template/party/profileblocks/PaymentMethods.ftl | 6 +++++-
 applications/party/webapp/partymgr/WEB-INF/controller.xml          | 7 +++++--
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/applications/party/template/party/profileblocks/ContentList.ftl b/applications/party/template/party/profileblocks/ContentList.ftl
index 4cc6919..49a505c 100644
--- a/applications/party/template/party/profileblocks/ContentList.ftl
+++ b/applications/party/template/party/profileblocks/ContentList.ftl
@@ -38,7 +38,7 @@ under the License.
                 <#if (content.contentName?has_content)>
                   <a href="<@ofbizUrl>stream?contentId=${(content.contentId)!}</@ofbizUrl>" target="_blank">${uiLabelMap.CommonView}</a>
                 </#if>
-                <form name="removePartyContent_${pContent_index}" method="post" action="<@ofbizUrl>removePartyContent/viewprofile</@ofbizUrl>">
+                <form name="removePartyContent_${pContent_index}" method="post" action="<@ofbizUrl>removePartyContent</@ofbizUrl>">
                   <input type="hidden" name="contentId" value="${pContent.contentId}" />
                   <input type="hidden" name="partyId" value="${pContent.partyId}" />
                   <input type="hidden" name="partyContentTypeId" value="${pContent.partyContentTypeId}" />
@@ -52,4 +52,4 @@ under the License.
       <#else>
         ${uiLabelMap.PartyNoContent}
       </#if>
-  </div>
\ No newline at end of file
+  </div>
diff --git a/applications/party/template/party/profileblocks/PaymentMethods.ftl b/applications/party/template/party/profileblocks/PaymentMethods.ftl
index baad093..f41f653 100644
--- a/applications/party/template/party/profileblocks/PaymentMethods.ftl
+++ b/applications/party/template/party/profileblocks/PaymentMethods.ftl
@@ -192,7 +192,11 @@ under the License.
                   &nbsp;
               </#if>
               <#if security.hasEntityPermission("PAY_INFO", "_DELETE", session) || security.hasEntityPermission("ACCOUNTING", "_DELETE", session)>
-                <a href="<@ofbizUrl>deletePaymentMethod/viewprofile?partyId=${partyId}&amp;paymentMethodId=${paymentMethod.paymentMethodId}</@ofbizUrl>">${uiLabelMap.CommonExpire}</a>
+                <form name="deletePaymentMethod_${paymentMethod.paymentMethodId}" method="post" action="<@ofbizUrl>deletePaymentMethod</@ofbizUrl>">
+                  <input type="hidden" name="partyId" value="${partyId}" />
+                  <input type="hidden" name="paymentMethodId" value="${paymentMethod.paymentMethodId}" />
+                  <input type="submit" value="${uiLabelMap.CommonExpire}"/>
+                </form>
               <#else>
                 &nbsp;
               </#if>
diff --git a/applications/party/webapp/partymgr/WEB-INF/controller.xml b/applications/party/webapp/partymgr/WEB-INF/controller.xml
index a9bee45..a0dbf48 100644
--- a/applications/party/webapp/partymgr/WEB-INF/controller.xml
+++ b/applications/party/webapp/partymgr/WEB-INF/controller.xml
@@ -1028,8 +1028,11 @@ under the License.
     <request-map uri="removePartyContent">
         <security auth="true" https="true"/>
         <event type="service" invoke="removePartyContent"/>
-        <response name="success" type="request-redirect" value="EditPartyContents">
-            <redirect-parameter name="partyId"></redirect-parameter>
+        <response name="success" type="request-redirect" value="viewprofile">
+            <redirect-parameter name="partyId"/>
+        </response>
+        <response name="error" type="request-redirect" value="viewprofile">
+            <redirect-parameter name="partyId"/>
         </response>
     </request-map>