Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0047546Openbravo ERPE. Translationpublic2021-08-13 09:442021-08-13 12:11
caristu 
caristu 
immediateminoralways
closedfixed 
5
 
PR21Q4 
Core
Pre packaging ( pi )
pi
https://gitlab.com/openbravo/product/openbravo/-/commit/0b38658966b3b6f7c03b9baca0945d491e796bcf [^]
No
0047546: Install a translation module from the command line fails
After the changes introduced with 0047259 the installation of translation modules fails from the command line. This is because in that case WeldUtils is not properly initialized because we are outside of a servlet context.
1) Clone a translation module into the modules folder. Ex: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core.es_ES [^]
2) Run ant smartbuild -Dlocal=no

The translation import process fails with the following error:

     [java] 2334 [main] ERROR org.openbravo.erpCommon.ad_forms.TranslationManager - importTrlFile - error parsing file: /home/openbravo/src/issues/openbravo/modules/org.openbravo.retail.posterminal.es_ES/referencedata/translation/es_ES//AD_ELEMENT_TRL_es_ES.xml
     [java] java.lang.NullPointerException: null
     [java] at org.openbravo.base.weld.WeldUtils.getStaticInstanceBeanManager(WeldUtils.java:54) ~[classes/:?]
     [java] at org.openbravo.base.weld.WeldUtils.getInstances(WeldUtils.java:129) ~[classes/:?]
No tags attached.
caused by defect 0047259 closed caristu Translation done with the 'Translator Helper' are now shown in the POS doing a 'Refresh data' or even Full Refresh 
Issue History
2021-08-13 09:44caristuNew Issue
2021-08-13 09:44caristuAssigned To => caristu
2021-08-13 09:44caristuModules => Core
2021-08-13 09:44caristuTriggers an Emergency Pack => No
2021-08-13 09:44caristuIssue generated from0047259
2021-08-13 09:44caristuRelationship addedcaused by 0047259
2021-08-13 09:45caristuRegression level => Pre packaging ( pi )
2021-08-13 09:45caristuRegression introduced in release => pi
2021-08-13 09:45caristuRegression introduced by commit => https://gitlab.com/openbravo/product/openbravo/-/commit/0b38658966b3b6f7c03b9baca0945d491e796bcf [^]
2021-08-13 09:56hgbotNote Added: 0131110
2021-08-13 11:18caristuSummaryInstall a translation module from the console fails => Install a translation module from the command line fails
2021-08-13 11:18caristuDescription Updatedbug_revision_view_page.php?rev_id=22996#r22996
2021-08-13 12:09vmromanosNote Added: 0131112
2021-08-13 12:11hgbotResolutionopen => fixed
2021-08-13 12:11hgbotStatusnew => closed
2021-08-13 12:11hgbotNote Added: 0131113
2021-08-13 12:11hgbotFixed in Version => PR21Q4
2021-08-13 12:11hgbotNote Added: 0131114

Notes
(0131110)
hgbot   
2021-08-13 09:56   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/423 [^]
(0131112)
vmromanos   
2021-08-13 12:09   
Tested and worked fine:
- Install source
- Translator Helper import properly updates POS labels after a refresh
(0131113)
hgbot   
2021-08-13 12:11   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/423 [^]
(0131114)
hgbot   
2021-08-13 12:11   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: cd23e2e3c994ee1d28f3566c3b1154f75189e338
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 2021-08-13T11:18:51+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/cd23e2e3c994ee1d28f3566c3b1154f75189e338 [^]

fixes ISSUE-47546: Install translations from command line fails

  The TranslationManagerHook instances are retrieved with WeldUtils
which can not be properly initialized outside of a servlet context, for
example when installing translations directly from the command line. In
that case a NPE was being thrown.

  Now we ensure that we are in a servlet context before trying to get
the TranslationManagerHook instances with WeldUtils.

---
M src/org/openbravo/erpCommon/ad_forms/TranslationManager.java
---