Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030561Openbravo ERPA. Platformpublic2015-08-12 14:552015-10-01 09:55
AugustoMauch 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
3.0PR15Q4 
alostale
Core
No
0030561: Use UPPER to achieve case insensitive filtering in CustomQuerySelectorDatasource
Most of the times we use UPPER to achieve case insensitive filtering throughout the Openbravo codebase.

CustomQuerySelectorDatasource uses LOWER instead, and this can be a problem, because if someone has defined a function based index that uses UPPER, the query built in CustomQuerySelectorDatasource would not be able to take advantage of it.

This will be the first step towards consolidating the use of UPPER, see [1]

[1] https://issues.openbravo.com/view.php?id=30476 [^]
Check that CustomQuerySelectorDatasource uses lower [1], when in most places we use upper (see for instances [2] and [3], where the queries used when filtering the grid are built).

[1] https://code.openbravo.com/erp/devel/pi/file/3b3aefef0ce7/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java#l383 [^]
[2] https://code.openbravo.com/erp/devel/pi/file/3b3aefef0ce7/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java#l737 [^]
[3] https://code.openbravo.com/erp/devel/pi/file/3b3aefef0ce7/modules/org.openbravo.service.json/src/org/openbravo/service/json/QueryBuilder.java#l233 [^]
No tags attached.
related to feature request 0030476 new AugustoMauch Consolidate the user of UPPER/LOWER to achieve case insensitive filtering 
related to defect 0030488 closed platform API Change: Replacement of LOWER with UPPER in queries 
related to defect 00251903.0PR14Q2 closed AugustoMauch Error when searching for characters like ß, in grid view 
Issue History
2015-08-12 14:55AugustoMauchNew Issue
2015-08-12 14:55AugustoMauchAssigned To => platform
2015-08-12 14:55AugustoMauchModules => Core
2015-08-12 14:55AugustoMauchTriggers an Emergency Pack => No
2015-08-12 14:56AugustoMauchRelationship addedrelated to 0030476
2015-08-12 14:57AugustoMauchRelationship addedrelated to 0030488
2015-08-12 14:57AugustoMauchStatusnew => scheduled
2015-08-12 15:02AugustoMauchIssue Monitored: alostale
2015-08-12 15:02AugustoMauchReview Assigned To => alostale
2015-08-12 15:07hgbotCheckin
2015-08-12 15:07hgbotNote Added: 0079324
2015-08-12 15:07hgbotStatusscheduled => resolved
2015-08-12 15:07hgbotResolutionopen => fixed
2015-08-12 15:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/66d1115c23d490a416344bc158a4673887fb4361 [^]
2015-08-12 15:09AugustoMauchNote Added: 0079325
2015-08-13 09:51alostaleRelationship addedrelated to 0025190
2015-08-13 10:07alostaleNote Added: 0079336
2015-08-13 10:07alostaleStatusresolved => new
2015-08-13 10:07alostaleResolutionfixed => open
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079542
2015-09-24 09:25hgbotCheckin
2015-09-24 09:25hgbotNote Added: 0080597
2015-09-24 09:25hgbotStatusnew => resolved
2015-09-24 09:25hgbotResolutionopen => fixed
2015-09-24 09:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/66d1115c23d490a416344bc158a4673887fb4361 [^] => http://code.openbravo.com/erp/devel/pi/rev/3e6a65bbb3ab4d0d2ef138aa62fc61c0d1722ac2 [^]
2015-09-24 17:29hudsonbotCheckin
2015-09-24 17:29hudsonbotNote Added: 0080626
2015-10-01 09:39alostaleAssigned Toplatform => AugustoMauch
2015-10-01 09:55alostaleNote Added: 0080772
2015-10-01 09:55alostaleStatusresolved => closed
2015-10-01 09:55alostaleFixed in Version => 3.0PR15Q4

Notes
(0079324)
hgbot   
2015-08-12 15:07   
Repository: erp/devel/pi
Changeset: 66d1115c23d490a416344bc158a4673887fb4361
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Aug 12 15:05:49 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/66d1115c23d490a416344bc158a4673887fb4361 [^]

Fixes issue 30561: UPPER is used inCustomQuerySelectorDatasource to build query

When the CustomQuerySelectorDatasource built the query to achieve case insensitive filtering, it used to use the LOWER function. We decided to change this, as UPPER is used much more often throughout the codebase. The fix has been checked with custom query selectors using both the iContains and the iStartsWith operators

---
M modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java
---
(0079325)
AugustoMauch   
2015-08-12 15:09   
To test this, you can check that the Business Partner selector of the Sales Order header tab keeps working properly using both the iContains and the iStartsWith operator
(0079336)
alostale   
2015-08-13 10:07   
reopening after code review:

Unnecessary value.toLowerCase() which is later transformed to upper in SQL, in order not to have the same problem as reported in 0025190, the only string transformation should be done in SQL.
(0079542)
hudsonbot   
2015-08-20 23:16   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/8c91718397a5 [^]
Maturity status: Test
(0080597)
hgbot   
2015-09-24 09:25   
Repository: erp/devel/pi
Changeset: 3e6a65bbb3ab4d0d2ef138aa62fc61c0d1722ac2
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Sep 22 17:36:37 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3e6a65bbb3ab4d0d2ef138aa62fc61c0d1722ac2 [^]

Fixes issue 30561: Removes unneeded toLowerCase()

---
M modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java
---
(0080626)
hudsonbot   
2015-09-24 17:29   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/37e30a4ff711 [^]
Maturity status: Test
(0080772)
alostale   
2015-10-01 09:55   
code reviewed

tested for selectors with both Contains and Starts with matching styles