[ofbiz-framework] branch release17.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 release17.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 release17.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


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

commit 4b43b0c639dac0fae93d7119843dcaebda15ea4b
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 af9d25d..a1344ed 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 da686c8..f7bea73 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 c248b50..84709f8 100644
--- a/applications/party/webapp/partymgr/WEB-INF/controller.xml
+++ b/applications/party/webapp/partymgr/WEB-INF/controller.xml
@@ -1017,8 +1017,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>