Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014633Openbravo ERPA. Platformpublic2010-09-21 12:382010-12-30 13:13
networkb 
alostale 
highminoralways
closedfixed 
5
2.50MP21 
3.0RC4 
Core
No
0014633: Wrong behaviour when printing messages using OBError, when messages belong to a module whose language is different than English
When developing a new java that prints an error message using OBError, if the module has been defined in Spanish, the message value of the ad_message is shown when loggin in spanish.
It seems that it tries to find a message in spanish on the ad_message_trl, but it has not been created because the module is being developed on spanish.

This error happens in the machine where the module has been development, but if you package it on a module, and install it on a different application the message is correct.
This is because when installing the module a new row for the message is created
on the ad_message_trl table for spanish language but this not happens when developing the module.

-Define a new module in spanish
-Create a message in spanish.
-Create a process that prints the error message using OBError object
-After compile see that the error shown is the value of the ad_message when should be the messagetext.
-Make the ob error to print the message of the ad_message instead of ad_message_trl table, when the message belongs to a module that is defined for a language different than english.

dev-platform-quick-wins
related to defect 0015072 closed alostale The display of help of edit of help is broken for module with baseLang != en_us 
depends on backport 00154172.50MP25 closed alostale Wrong behaviour when printing messages using OBError, when messages belong to a module whose language is different than English 
? BudgetConfigurationUtility.java (8,024) 2010-11-17 13:00
https://issues.openbravo.com/file_download.php?file_id=3329&type=bug
Issue History
2010-09-21 12:38networkbNew Issue
2010-09-21 12:38networkbAssigned To => alostale
2010-09-21 12:49rafarodaIssue Monitored: rafaroda
2010-09-27 08:45alostaleStatusnew => scheduled
2010-09-27 08:45alostalefix_in_branch => pi
2010-09-27 16:27rafarodaTag Attached: dev-platform-quick-wins
2010-10-01 11:08alostaleNote Added: 0031535
2010-10-01 11:08alostaleAssigned Toalostale => networkb
2010-10-01 11:08alostaleStatusscheduled => feedback
2010-11-17 12:55egoitzNote Added: 0032660
2010-11-17 12:55egoitzAssigned Tonetworkb => alostale
2010-11-17 12:55egoitzStatusfeedback => new
2010-11-17 12:55egoitzTarget Version2.50MP23 => 2.50MP25
2010-11-17 12:55egoitzfix_in_branchpi =>
2010-11-17 12:55egoitzDescription Updatedbug_revision_view_page.php?rev_id=1208#r1208
2010-11-17 12:55egoitzSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=1210#r1210
2010-11-17 13:00egoitzFile Added: BudgetConfigurationUtility.java
2010-11-17 13:13shuehnerNote Added: 0032663
2010-11-17 13:14shuehnerNote Edited: 0032663bug_revision_view_page.php?bugnote_id=0032663#r1212
2010-11-17 13:19shuehnerRelationship addedrelated to 0015072
2010-11-22 08:35alostaleStatusnew => scheduled
2010-12-14 11:44alostaleStatusscheduled => acknowledged
2010-12-14 11:44alostaleStatusacknowledged => scheduled
2010-12-14 11:44alostalefix_in_branch => pi
2010-12-14 11:45alostaleTarget Version2.50MP25 => 3.0RC4
2010-12-14 11:45alostalefix_in_branchpi =>
2010-12-14 11:46hgbotCheckin
2010-12-14 11:46hgbotNote Added: 0033154
2010-12-14 11:46hgbotStatusscheduled => resolved
2010-12-14 11:46hgbotResolutionopen => fixed
2010-12-14 11:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bce4bc9e881ec5376d9bba855fce93e03a3e84b9 [^]
2010-12-14 19:30shuehnerNote Added: 0033184
2010-12-14 19:30shuehnerStatusresolved => closed
2010-12-16 22:15anonymoussf_bug_id0 => 3138781
2010-12-30 13:13hudsonbotCheckin
2010-12-30 13:13hudsonbotNote Added: 0033441

Notes
(0031535)
alostale   
2010-10-01 11:08   
Please can you provide a code snippet about how to make this fail.

OBError is not in charge of translations, so from the bug description is not clear how this is used when it is not working.
(0032660)
egoitz   
2010-11-17 12:55   
the description has been updated because an error on the explanation.
(0032663)
shuehner   
2010-11-17 13:13   
(edited on: 2010-11-17 13:14)
Note: Broken code is most likely the following function:

org.openbravo.erpCommon.utility.Utility, function messageBD
as it hardcoded checks for lang = 'en_US' and doesn't look into the _TRL table in that case, which is broken with modules with a different baseLanguage.

Note, needs to be fixed multiple times in that method

(0033154)
hgbot   
2010-12-14 11:46   
Repository: erp/devel/pi
Changeset: bce4bc9e881ec5376d9bba855fce93e03a3e84b9
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Dec 14 11:45:49 2010 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/bce4bc9e881ec5376d9bba855fce93e03a3e84b9 [^]

fixed bug 14633: Wrong behaviour when printing messages using OBError

---
M src/org/openbravo/erpCommon/utility/MessageBD_data.xsql
M src/org/openbravo/erpCommon/utility/Utility.java
---
(0033184)
shuehner   
2010-12-14 19:30   
Reviewed & Tested in stable/2.50/pgsql (rev: 2fbe2449d3ac), the method is now working fine reading both base-language & extra-language values in both base-language en_US (like corE) and with a module in another base-language (like de_DE)
(0033441)
hudsonbot   
2010-12-30 13:13   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/bce4bc9e881e [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/7d7e5eebcc62 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.19448.obx [^]