Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0045425 | Openbravo ERP | A. Platform | public | 2020-11-11 14:19 | 2020-11-12 10:11 |
|
Reporter | cberner | |
Assigned To | cberner | |
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | PR21Q1 | |
Merge Request Status | |
Review Assigned To | |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0045425: ParametersActionHandler.onSave is not embedding parameters using OBCriteria |
Description | ParametersActionHandler.onSave method is embedding parameters directly in the OBQuery HQL where clause, it should instead use OBCriteria.
Relevant code:
OBQuery<ParameterValue> obq = OBDal.getInstance()
.createQuery(ParameterValue.class,
dbFilterProperty + " = :filter and parameter = :param") |
Steps To Reproduce | In description. |
Proposed Solution | Use OBCriteria instead. |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | design defect | 0038136 | | acknowledged | Triage Platform Base | Tracking issue: Find & Fix queries not using bind-params but embedding values into query string |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2020-11-11 14:19 | cberner | New Issue | |
2020-11-11 14:19 | cberner | Assigned To | => cberner |
2020-11-11 14:19 | cberner | Modules | => Core |
2020-11-11 14:19 | cberner | Triggers an Emergency Pack | => No |
2020-11-11 14:22 | cberner | Relationship added | related to 0038136 |
2020-11-11 14:23 | hgbot | Note Added: 0124281 | |
2020-11-11 14:25 | cberner | Note Added: 0124282 | |
2020-11-12 10:11 | hgbot | Resolution | open => fixed |
2020-11-12 10:11 | hgbot | Status | new => closed |
2020-11-12 10:11 | hgbot | Note Added: 0124302 | |
2020-11-12 10:11 | hgbot | Fixed in Version | => PR21Q1 |
2020-11-12 10:11 | hgbot | Note Added: 0124303 | |
Notes |
|
(0124281)
|
hgbot
|
2020-11-11 14:23
|
|
|
|
|
Test Plan:
1. Login
2. Add a new widget(User Defined HTML Widget) from left panel.
3. Complete fields and save, this will trigger the modified query. |
|
|
(0124302)
|
hgbot
|
2020-11-12 10:11
|
|
|
|
(0124303)
|
hgbot
|
2020-11-12 10:11
|
|
Directly closing issue as related merge request is already approved.
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: a422ed1ff10a79c4089ef78913da2ad5643cef77
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2020-11-12T09:10:53+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/a422ed1ff10a79c4089ef78913da2ad5643cef77 [^]
Fixes ISSUE-45425: ParametersActionHandler.onSave is embedding parameters wrongly
ParametersActionHandler.onSave method is embedding parameters directly
in the OBQuery HQL where clause. This fixes it by using OBCriteria
instead, which is also safer.
Also a minor refactor has been done:
* f assignment was unneded, we only care about the exception
* use proxies instead of retrieving the object from db. They are used
only to check id, there is no need to retrieve it from db, we don't
care at this stage if the row is even present in db, filter will
return empty if so.
* parameterize log
---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/ParametersActionHandler.java
---
|
|