Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0045447Openbravo ERPA. Platformpublic2020-11-16 10:042020-12-02 13:50
cberner 
cberner 
normalminorhave not tried
closedfixed 
5
 
PR21Q1 
Core
No
0045447: DimensionDisplayUtility uses String.format over hql to introduce certain params
This class uses String.format on certain HQL query strings to replace certain params, it should instead include the params already in the query and not require usage of String.format.

Problematic format here: https://gitlab.com/openbravo/product/openbravo/-/blob/master/src/org/openbravo/erpCommon/utility/DimensionDisplayUtility.java#L427 [^]
In description.
Use the property, which in this case is actually a fixed String value on the HQL query.
No tags attached.
Issue History
2020-11-16 10:04cbernerNew Issue
2020-11-16 10:04cbernerAssigned To => cberner
2020-11-16 10:04cbernerModules => Core
2020-11-16 10:04cbernerTriggers an Emergency Pack => No
2020-11-16 10:07hgbotNote Added: 0124404
2020-11-25 18:42hgbotNote Added: 0124626
2020-12-02 13:42hgbotResolutionopen => fixed
2020-12-02 13:42hgbotStatusnew => closed
2020-12-02 13:42hgbotNote Added: 0124689
2020-12-02 13:42hgbotFixed in Version => PR21Q1
2020-12-02 13:42hgbotNote Added: 0124690
2020-12-02 13:50cbernerNote Added: 0124691

Notes
(0124404)
hgbot   
2020-11-16 10:07   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/232 [^]
(0124626)
hgbot   
2020-11-25 18:42   
Merge request closed: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/232 [^]
(0124689)
hgbot   
2020-12-02 13:42   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/232 [^]
(0124690)
hgbot   
2020-12-02 13:42   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 6003c40d332b7f9d44d07fdaf5185023de26e44b
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2020-12-02T13:34:36+01:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/6003c40d332b7f9d44d07fdaf5185023de26e44b [^]

Fixes ISSUE-45447: DimensionDisplayUtility uses String.format over hql for params

It uses String.format on certain HQL queries to introduce some params
conditionally, this is not fully safe, so to avoid this it now includes
the fixed String value in the HQL string.

---
M src/org/openbravo/erpCommon/utility/DimensionDisplayUtility.java
---
(0124691)
cberner   
2020-12-02 13:50   
Test Plan:

1. Log in as Openbravo User
2. Open "Financial Account" window (Contains several Display logics that will execute the modified query)
3. Check that everything loaded as expected and there are no errors in Openbravo log.