details:   /erp/devel/pi/rev/88428c9b2bcc
changeset: 8441:88428c9b2bcc
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.

diffstat:

 src/org/openbravo/erpCommon/ad_forms/TranslationHandler.java |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (16 lines):

diff -r 3d8ae9cb28d5 -r 88428c9b2bcc 
src/org/openbravo/erpCommon/ad_forms/TranslationHandler.java
--- a/src/org/openbravo/erpCommon/ad_forms/TranslationHandler.java      Fri Sep 
24 11:03:37 2010 +0530
+++ b/src/org/openbravo/erpCommon/ad_forms/TranslationHandler.java      Fri Sep 
24 08:42:01 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

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to