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
The following commit(s) were added to refs/heads/trunk by this push: new 414e4d8 Fixed: Macro renderLink default height and width not retrieved on menus (OFBIZ-12279) 414e4d8 is described below commit 414e4d83ed10338267f40ef1aa032a6f97e1e927 Author: Jacques Le Roux <jacques.le.r...@les7arts.com> AuthorDate: Mon Jul 12 12:03:59 2021 +0200 Fixed: Macro renderLink default height and width not retrieved on menus (OFBIZ-12279) Menus link defaut parameters for height and width are not considered when the link is generated. When parameter with empty value is passed to the macro, macro default values are not retrieved. To reproduce you can create a "layered-modal" type link in a menu and click on the link (without height nor width): this will generate the link with parameters "data-dialog-height" and "data-dialog-width" empty Patch provided When applied, the MacroMenuRenderer.renderLink will not send empty values to the macro so that default value will be retrieved (what is actually done on MacroFormRenderer.renderLookup) Thanks: Leila --- applications/order/widget/ordermgr/OrderMenus.xml | 7 +++++++ .../org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/applications/order/widget/ordermgr/OrderMenus.xml b/applications/order/widget/ordermgr/OrderMenus.xml index 860cf80..2c2b03e 100644 --- a/applications/order/widget/ordermgr/OrderMenus.xml +++ b/applications/order/widget/ordermgr/OrderMenus.xml @@ -27,6 +27,13 @@ under the License. </or> </condition> <link target="FindRequest"/> + <menu-item name="test"> + <link target="CreateNewOrderMessage" link-type="layered-modal" > + <parameter param-name="orderId"/> + <parameter param-name="communicationEventPrpTypId"/> + </link> + </menu-item> + </menu-item> <menu-item name="quote" title="${uiLabelMap.OrderOrderQuotes}"> diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java index f6a3276..90178d2 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java @@ -212,10 +212,14 @@ public class MacroMenuRenderer implements MenuStringRenderer { "style", link.getStyle(context), "name", link.getName(context), "text", link.getText(context), - "height", link.getHeight(), - "width", link.getWidth(), "targetWindow", link.getTargetWindow(context)); + String linkHeight = link.getHeight(); + if (UtilValidate.isNotEmpty(linkHeight)) parameters.put("height", linkHeight); + + String linkWidth = link.getWidth(); + if (UtilValidate.isNotEmpty(linkWidth)) parameters.put("width", linkWidth); + StringBuffer uniqueItemName = new StringBuffer(menuItem.getModelMenu().getName()); uniqueItemName.append("_").append(menuItem.getName()).append("_LF_").append(UtilMisc.<String>addToBigDecimalInMap(context, "menuUniqueItemIndex", BigDecimal.ONE));