details:   /erp/devel/main/rev/0a51901e72b0
changeset: 8449:0a51901e72b0
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Fri Sep 24 08:42:01 2010 +0200
summary:   fixed issue 14689: Tranlation does not work in PG

  Translation process now sets NULL instead of '' for empty strings. This
  makes Oracle,  PostgreSQL and edition from UI behave in the same way,
  making also to work properly SQL code expecting null for empty strings.
  This last case was what made the translation to fail in AD_Element_Trl_Trg
  trigger.

details:   /erp/devel/main/rev/7b83840c6f34
changeset: 8450:7b83840c6f34
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Fri Sep 24 11:37:55 2010 +0200
summary:   Fixed issue 14695. Prevent NullPointerException when using the 
rebuild window with some language whose translation module has been uninstalled

details:   /erp/devel/main/rev/da1ba9bd3171
changeset: 8451:da1ba9bd3171
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Fri Sep 24 12:27:34 2010 +0200
summary:   related to issue 14689

  When updating ad_element_trl check for changes in PO* columns, this solves:
    -A change in a PO* column was not propagated to its trl fields if there was
     not also a change in any other column.
    -Reinstalling a language didn't made changes as data is not previously 
removed,
     so the only change after previos fix was changes in PO* from '' to null

diffstat:

 src-db/database/model/triggers/AD_ELEMENT_TRL_TRG.xml        |  9 +++++----
 src/org/openbravo/erpCommon/ad_forms/TranslationHandler.java |  4 ++--
 src/org/openbravo/erpCommon/ad_process/ApplyModules.java     |  2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

diffs (53 lines):

diff -r 87617bcebd82 -r da1ba9bd3171 
src-db/database/model/triggers/AD_ELEMENT_TRL_TRG.xml
--- a/src-db/database/model/triggers/AD_ELEMENT_TRL_TRG.xml     Wed Sep 22 
13:13:54 2010 +0200
+++ b/src-db/database/model/triggers/AD_ELEMENT_TRL_TRG.xml     Fri Sep 24 
12:27:34 2010 +0200
@@ -38,12 +38,13 @@
   IF UPDATING
   THEN
     IF (   COALESCE (:OLD.NAME, '.') <> COALESCE (:NEW.NAME, '.')
-        OR COALESCE (:OLD.Description, '.') <>
-                                              COALESCE (:NEW.Description, '.')
+        OR COALESCE (:OLD.Description, '.') <> COALESCE (:NEW.Description, '.')
         OR COALESCE (:OLD.HELP, '.') <> COALESCE (:NEW.HELP, '.')
         OR COALESCE (:OLD.PrintName, '.') <> COALESCE (:NEW.PrintName, '.')
-        OR COALESCE (:OLD.IsTranslated, '.') <>
-                                             COALESCE (:NEW.IsTranslated, '.')
+        OR COALESCE (:OLD.IsTranslated, '.') <> COALESCE (:NEW.IsTranslated, 
'.')
+        OR COALESCE (:OLD.PO_NAME, '.') <> COALESCE (:NEW.PO_NAME, '.')
+        OR COALESCE (:OLD.PO_Description, '.') <> COALESCE 
(:NEW.PO_Description, '.')
+        OR COALESCE (:OLD.PO_HELP, '.') <> COALESCE (:NEW.PO_HELP, '.')
        )
     THEN
       -- Field
diff -r 87617bcebd82 -r da1ba9bd3171 
src/org/openbravo/erpCommon/ad_forms/TranslationHandler.java
--- a/src/org/openbravo/erpCommon/ad_forms/TranslationHandler.java      Wed Sep 
22 13:13:54 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/TranslationHandler.java      Fri Sep 
24 12:27:34 2010 +0200
@@ -224,10 +224,10 @@
    *          String with text
    * @param maxLength
    *          Maximum Length of content or 0 to ignore
-   * @return escaped string for insert statement (NULL if null)
+   * @return escaped string for insert statement (NULL if null or empty)
    */
   private String TO_STRING(String txt, int maxLength) {
-    if (txt == null)
+    if (txt == null || txt.isEmpty())
       return "NULL";
 
     // Length
diff -r 87617bcebd82 -r da1ba9bd3171 
src/org/openbravo/erpCommon/ad_process/ApplyModules.java
--- a/src/org/openbravo/erpCommon/ad_process/ApplyModules.java  Wed Sep 22 
13:13:54 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ApplyModules.java  Fri Sep 24 
12:27:34 2010 +0200
@@ -313,11 +313,11 @@
         return nodeData;
       } else {
         BuildTranslation buildTranslation = 
getBuildTranslationFromFile(vars.getLanguage());
-        buildTranslation.setBuild(build);
         if (buildTranslation == null) {
           FieldProvider[] nodeData = build.getFieldProvidersForBuild();
           return nodeData;
         }
+        buildTranslation.setBuild(build);
         FieldProvider[] nodeData = 
buildTranslation.getFieldProvidersForBuild();
         return nodeData;
       }

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to