You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2020/12/25 15:19:45 UTC

[ofbiz-framework] 02/02: Fixed: Unique form names for promo actions (OFBIZ-12082)

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

commit aa4791f1200c6d91e7597b46d77aa3c557928394
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Fri Dec 25 16:17:35 2020 +0100

    Fixed: Unique form names for promo actions (OFBIZ-12082)
    
    Creating a promo with multiple rules and actions results in an exception.
    
    It's reproducible by creating a promo with 1 rule and more than 1 Action and
    specifying different products for each Action. When creating the second Action
    and trying to specify another product to included the ajax request LookupProduct
    will fail because it included both product ids in its xhr request.
    
    Thanks: Danny Trunk
---
 applications/product/template/promo/EditProductPromoRules.ftl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/applications/product/template/promo/EditProductPromoRules.ftl b/applications/product/template/promo/EditProductPromoRules.ftl
index bcb076f..9c489d5 100644
--- a/applications/product/template/promo/EditProductPromoRules.ftl
+++ b/applications/product/template/promo/EditProductPromoRules.ftl
@@ -280,7 +280,7 @@ under the License.
               <td>
                 <div>
                   <b> ${uiLabelMap.ProductAction} ${(productPromoAction.productPromoActionSeqId)!}</b>
-                  <form method="post" action="<@o...@ofbizUrl>" name="updateProductPromoAction">
+                  <form method="post" action="<@o...@ofbizUrl>" name="updateProductPromoAction_${productPromoRule_index}_${productPromoAction_index}">
                     <input type="hidden" name="productPromoId" value="${(productPromoAction.productPromoId)!}" />
                     <input type="hidden" name="productPromoRuleId" value="${(productPromoAction.productPromoRuleId)!}" />
                     <input type="hidden" name="productPromoActionSeqId" value="${(productPromoAction.productPromoActionSeqId)!}" />
@@ -310,9 +310,9 @@ under the License.
                     ${uiLabelMap.ProductQuantity}:&nbsp;<input type="text" size="5" name="quantity" value="${(productPromoAction.quantity)!}" />
                     ${uiLabelMap.ProductAmount}:&nbsp;<input type="text" size="5" name="amount" value="${(productPromoAction.amount)!}" />
                     <br/>
-                    ${uiLabelMap.ProductItemId}:&nbsp;<@htmlTemplate.lookupField value="${(productPromoAction.productId)!}" formName="updateProductPromoAction" name="productId" id="productId" fieldFormName="LookupProduct"/>
+                    ${uiLabelMap.ProductItemId}:&nbsp;<@htmlTemplate.lookupField value="${(productPromoAction.productId)!}" formName="updateProductPromoAction_${productPromoRule_index}_${productPromoAction_index}" name="productId" id="productId" fieldFormName="LookupProduct"/>
                     <br/>
-                    ${uiLabelMap.PartyParty}:&nbsp;<@htmlTemplate.lookupField value="${(productPromoAction.partyId)!}" formName="updateProductPromoAction" name="partyId" id="partyId" fieldFormName="LookupUserLoginAndPartyDetails"/>
+                    ${uiLabelMap.PartyParty}:&nbsp;<@htmlTemplate.lookupField value="${(productPromoAction.partyId)!}" formName="updateProductPromoAction_${productPromoRule_index}_${productPromoAction_index}" name="partyId" id="partyId" fieldFormName="LookupUserLoginAndPartyDetails"/>
                     <br/>
                     ${uiLabelMap.ProductServiceName}:&nbsp;<input type="text" size="20" name="serviceName" value="${(productPromoAction.serviceName)!}" />
                     ${uiLabelMap.UseCartQuantity}:&nbsp;