[ofbiz-framework] branch release18.12 updated (8bdf4d4 -> 5860dbe)

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

[ofbiz-framework] branch release18.12 updated (8bdf4d4 -> 5860dbe)

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

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


    from 8bdf4d4  Fixed: Make ruleName field in PriceForms.xml#AddPriceRules safe (OFBIZ-12098)
     new c91c4f8  Fixed: Issue in creating promotion action (OFBIZ-11168)
     new 5860dbe  Fixed: Unique form names for promo actions (OFBIZ-12082)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../product/template/promo/EditProductPromoRules.ftl  | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] 01/02: Fixed: Issue in creating promotion action (OFBIZ-11168)

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

commit c91c4f856db5c57cb5fd45126ea2f9c0cc5d8ba3
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Fri Dec 25 16:09:43 2020 +0100

    Fixed: Issue in creating promotion action (OFBIZ-11168)
   
    The issue reported there was fixed with OFBIZ-11058.
   
    But there was still an issue in logI reported in a comment.
   
    The problem was that
    <#assign productPromoActionCurEnum = productPromoAction.getRelatedOne("ActionEnumeration", true)>
    was used in 2 places where it should not have been because it returned a null
    value that can't be handled by OFBiz.
   
    Better use
    <#assign productPromoActionCustomMethod = productPromoAction.getRelatedOne("CustomMethod", true)>
    and
    productPromoAction.getRelatedOne("ActionEnumeration", true))??
   
    The repercussion was that the description was not used but the Id and the log
    was showing an error.
---
 .../product/template/promo/EditProductPromoRules.ftl        | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/applications/product/template/promo/EditProductPromoRules.ftl b/applications/product/template/promo/EditProductPromoRules.ftl
index 757f884..facd7f3 100644
--- a/applications/product/template/promo/EditProductPromoRules.ftl
+++ b/applications/product/template/promo/EditProductPromoRules.ftl
@@ -291,8 +291,14 @@ under the License.
                     <input type="hidden" name="productPromoActionSeqId" value="${(productPromoAction.productPromoActionSeqId)!}" />
                     <select name="customMethodId" size="1">
       <#if (productPromoAction.customMethodId)??>
-        <#assign productPromoActionCurEnum = productPromoAction.getRelatedOne("ActionEnumeration", true)>
-                      <option value="${(productPromoAction.customMethodId)!}"><#if productPromoActionCurEnum??>${(productPromoActionCurEnum.get("description",locale))!}<#else>[${(productPromoAction.customMethodId)!}]</#if></option>
+        <#assign productPromoActionCustomMethod = productPromoAction.getRelatedOne("CustomMethod", true)>
+                      <option value="${(productPromoAction.customMethodId)!}">
+                        <#if (productPromoActionCurEnum = productPromoAction.getRelatedOne("ActionEnumeration", true))??>
+                            ${(productPromoActionCurEnum.get("description",locale))!}
+                        <#else>
+                            ${(productPromoActionCustomMethod.get("description",locale))!}
+                        </#if>
+                      </option>
                       <option value="${(productPromoAction.customMethodId)!}">&nbsp;</option>
         <#elseif (productPromoAction.productPromoActionEnumId)??>
           <#assign actionEnumeration = productPromoAction.getRelatedOne("ActionEnumeration", true)! />
@@ -317,7 +323,6 @@ under the License.
                     ${uiLabelMap.UseCartQuantity}:&nbsp;
                     <select name="useCartQuantity">
       <#if (productPromoAction.useCartQuantity)??>
-        <#assign productPromoActionCurEnum = productPromoAction.getRelatedOne("ActionEnumeration", true)>
                       <option value="${(productPromoAction.useCartQuantity)!}"><#if ("Y" == productPromoAction.useCartQuantity)>${uiLabelMap.CommonY}<#else>${uiLabelMap.CommonN}</#if></option>
                       <option value="${(productPromoAction.useCartQuantity)!}">&nbsp;</option>
       <#else>
@@ -392,7 +397,7 @@ under the License.
                 <div>
                   ${(actionProduct.internalName)!} [${actionProductPromoProduct.productId}]
                   - ${(actionApplEnumeration.get("description",locale))?default(actionProductPromoProduct.productPromoApplEnumId)}
-                  <form name="deleteProductPromoProductAction_${productPromoRule_index}_${productPromoAction_index}_${actionProductPromoProduct_index}" method="post" action="<@ofbizUrl>deleteProductPromoProduct</@ofbizUrl>">
+                  <form name="deleteProductPromoProductAction_${productPromoRule_index}_${productPromoAction_index}_${actionProductPromoProduct_index}" method="post" action="<@ofbizUrl>deleteProductPromoProduct</@ofbizUrl>">
                     <input type="hidden" name="productPromoId" value="${(actionProductPromoProduct.productPromoId)!}" />
                     <input type="hidden" name="productPromoRuleId" value="${(actionProductPromoProduct.productPromoRuleId)!}" />
                     <input type="hidden" name="productPromoCondSeqId" value="${(actionProductPromoProduct.productPromoCondSeqId)!}" />

Reply | Threaded
Open this post in threaded view
|

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

jleroux@apache.org
In reply to this post by 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

commit 5860dbe3cc1d79e3aeae5454d7a43650fa14c58b
Author: Jacques Le Roux <[hidden email]>
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="<@ofbizUrl>updateProductPromoAction</@ofbizUrl>" name="updateProductPromoAction">
+                  <form method="post" action="<@ofbizUrl>updateProductPromoAction</@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}:&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;