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/06/18 15:54:44 UTC

[ofbiz-framework] branch release17.12 updated: Fixed: getEntityRefData service has a weird issue (OFBIZ-11401)

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


The following commit(s) were added to refs/heads/release17.12 by this push:
     new 4079b54  Fixed: getEntityRefData service has a weird issue (OFBIZ-11401)
4079b54 is described below

commit 4079b54ece0644467f2a3f945256fa81279539a9
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Thu Jun 18 17:51:36 2020 +0200

    Fixed: getEntityRefData service has a weird issue (OFBIZ-11401)
    
    It's reproductible on trunk demo though only visible in log, UI shows no issue
    
    R17 and R18 are also affected, R16 is OK.
    
    Ankush: This stacktrace should be coming for all entities where
    default-resource-name is defined on entity definition but no property exist in
    defined resource for key EntityDescription.entityname and FieldDescription.field.
    
    As we want to have these entity labels as much as possible, we can simply print
    warning about the missing entity descriptions and field descriptions for
    readability purpose instead of printing huge exceptions stacktrace.
    
    Thanks: Ankush Upadhyay and Pierre Smits for the help
    
    Handled by hand (swallowing exceptions is lazy and bad :p)
---
 .../java/org/apache/ofbiz/webtools/WebToolsServices.java    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
index 4e660a3..68a2865 100644
--- a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
+++ b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
@@ -663,7 +663,9 @@ public class WebToolsServices {
                         if (bundle != null) {
                             try {
                                 entityDescription = bundle.getString("EntityDescription." + entity.getEntityName());
-                            } catch (Exception exception) {}
+                            } catch (Exception exception) {
+                                Debug.logWarning("EntityDescription for entity " + entity.getEntityName() + " is missing", module);
+                            }
                         }
                         if (UtilValidate.isEmpty(entityDescription)) {
                             entityDescription = entity.getDescription();
@@ -682,7 +684,10 @@ public class WebToolsServices {
                             if (bundle != null) {
                                 try {
                                     fieldDescription = bundle.getString("FieldDescription." + entity.getEntityName() + "." + field.getName());
-                                } catch (Exception exception) {}
+                                } catch (Exception exception) {
+                                    Debug.logWarning("FieldDescription for entity.field " + entity.getEntityName() + "."
+                                            + field.getName() + " is missing", module);
+                                }
                             }
                             if (UtilValidate.isEmpty(fieldDescription)) {
                                 fieldDescription = field.getDescription();
@@ -690,7 +695,9 @@ public class WebToolsServices {
                             if (UtilValidate.isEmpty(fieldDescription) && bundle != null) {
                                 try {
                                 fieldDescription = bundle.getString("FieldDescription." + field.getName());
-                                } catch (Exception exception) {}
+                                } catch (Exception exception) {
+                                    Debug.logWarning("FieldDescription for field " + field.getName() + " is missing", module);
+                                }
                             }
                             if (UtilValidate.isEmpty(fieldDescription)) {
                                 fieldDescription = ModelUtil.javaNameToDbName(field.getName()).toLowerCase();