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:52 UTC
[ofbiz-framework] 03/03: 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 trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit 6110ced974c686a82bf3747430ea70e4541366b2
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 facd7f3..08bea18 100644
--- a/applications/product/template/promo/EditProductPromoRules.ftl
+++ b/applications/product/template/promo/EditProductPromoRules.ftl
@@ -285,7 +285,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)!}" />
@@ -315,9 +315,9 @@ under the License.
${uiLabelMap.ProductQuantity}: <input type="text" size="5" name="quantity" value="${(productPromoAction.quantity)!}" />
${uiLabelMap.ProductAmount}: <input type="text" size="5" name="amount" value="${(productPromoAction.amount)!}" />
<br/>
- ${uiLabelMap.ProductItemId}: <@htmlTemplate.lookupField value="${(productPromoAction.productId)!}" formName="updateProductPromoAction" name="productId" id="productId" fieldFormName="LookupProduct"/>
+ ${uiLabelMap.ProductItemId}: <@htmlTemplate.lookupField value="${(productPromoAction.productId)!}" formName="updateProductPromoAction_${productPromoRule_index}_${productPromoAction_index}" name="productId" id="productId" fieldFormName="LookupProduct"/>
<br/>
- ${uiLabelMap.PartyParty}: <@htmlTemplate.lookupField value="${(productPromoAction.partyId)!}" formName="updateProductPromoAction" name="partyId" id="partyId" fieldFormName="LookupUserLoginAndPartyDetails"/>
+ ${uiLabelMap.PartyParty}: <@htmlTemplate.lookupField value="${(productPromoAction.partyId)!}" formName="updateProductPromoAction_${productPromoRule_index}_${productPromoAction_index}" name="partyId" id="partyId" fieldFormName="LookupUserLoginAndPartyDetails"/>
<br/>
${uiLabelMap.ProductServiceName}: <input type="text" size="20" name="serviceName" value="${(productPromoAction.serviceName)!}" />
${uiLabelMap.UseCartQuantity}: