Fixes Issue 26871: Error when clicking table tree category drop down in Tabs
authorShankar Balachandran <shankar.balachandran@openbravo.com>
Mon, 16 Jun 2014 13:48:57 +0530
changeset 23489 35f07a0e0eec
parent 23488 c9239985dde2
child 23490 10cba80c42cc
Fixes Issue 26871: Error when clicking table tree category drop down in Tabs

When the property is tried to fetch from ancestor tabs and not found, error was being raised.
But if the property is part of the context, then it is fetched later, so ignored the property exception.
modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java	Sun Jun 15 20:54:34 2014 +0530
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java	Mon Jun 16 13:48:57 2014 +0530
@@ -1112,8 +1112,13 @@
           if (tabEntity.equals(paramEntity)) {
             paramValue = vars.getStringParameter("@" + paramEntity.getName() + ".id@");
           } else {
-            Property prop = tabEntity.getPropertyByColumnName(param);
-            paramValue = vars.getStringParameter("@" + tabEntity + "." + prop.getName() + "@");
+            try {
+              Property prop = tabEntity.getPropertyByColumnName(param);
+              paramValue = vars.getStringParameter("@" + tabEntity + "." + prop.getName() + "@");
+            } catch (Exception ignore) {
+              // ignoring exception as the property might be found from context.
+              // for eg., refer issue https://issues.openbravo.com/view.php?id=26871
+            }
           }
           ancestorTab = KernelUtils.getInstance().getParentTab(ancestorTab);
         }