Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033073Openbravo ERPA. Platformpublic2016-05-30 10:532016-08-30 14:35
caristu 
NaroaIriarte 
immediatemajorhave not tried
closedfixed 
5
 
3.0PR16Q3 
alostale
Core
Pre packaging ( pi )
2016-04-08
pi
https://code.openbravo.com/erp/devel/pi/rev/69d2b535ae86 [^]
No
0033073: Where parameter can not be used in JSON webservices
The _where parameter is not working in standard JSON webservices[1]. Now, to enter a where clause the whereAndFilterClause parameter is used instead.


[1] http://wiki.openbravo.com/wiki/JSON_REST_Web_Services#GET [^]
1) In a version before this changeset[1] try the following WS call:

http://localhost:8080/openbravo/org.openbravo.service.json.jsonrest/Country?_where=name='Spain' [^]

Notice that the data is filtered properly.

2) In current pi version try the following WS call:

http://localhost:8080/openbravo/org.openbravo.service.json.jsonrest/Country?_where=name='Spain' [^]

Data is not filtered. The following WS call must be done instead:

http://localhost:8080/openbravo/org.openbravo.service.json.jsonrest/Country?whereAndFilterClause=name='Spain' [^]

[1] https://code.openbravo.com/erp/devel/pi/rev/69d2b535ae86 [^]
No tags attached.
caused by feature request 00326103.0PR16Q3 closed NaroaIriarte standard datasources shouldn't accept where parameter by default 
Issue History
2016-05-30 10:53caristuNew Issue
2016-05-30 10:53caristuAssigned To => platform
2016-05-30 10:53caristuModules => Core
2016-05-30 10:53caristuRegression introduced in release => pi
2016-05-30 10:53caristuRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/69d2b535ae86 [^]
2016-05-30 10:53caristuTriggers an Emergency Pack => No
2016-05-30 10:54caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12251#r12251
2016-05-30 10:55caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12252#r12252
2016-05-30 10:56caristuRegression level => Pre packaging ( pi )
2016-05-30 10:56caristuRegression date => 2016-04-08
2016-05-30 10:58caristuDescription Updatedbug_revision_view_page.php?rev_id=12254#r12254
2016-05-30 11:27alostaleStatusnew => scheduled
2016-05-30 11:27alostaleAssigned Toplatform => NaroaIriarte
2016-05-30 11:27alostaleStatusscheduled => acknowledged
2016-05-30 11:29alostaleRelationship addedcaused by 0032610
2016-05-30 11:29alostaleStatusacknowledged => scheduled
2016-05-31 12:03hgbotCheckin
2016-05-31 12:03hgbotNote Added: 0086857
2016-05-31 12:03hgbotStatusscheduled => resolved
2016-05-31 12:03hgbotResolutionopen => fixed
2016-05-31 12:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/468a1d34cac5286b8ef079733241dafffc7e7757 [^]
2016-05-31 12:03hgbotCheckin
2016-05-31 12:03hgbotNote Added: 0086858
2016-05-31 12:09NaroaIriarteReview Assigned To => alostale
2016-06-03 09:27alostaleNote Added: 0086977
2016-06-03 09:27alostaleStatusresolved => closed
2016-06-03 09:27alostaleFixed in Version => 3.0PR16Q3
2016-06-17 19:38hudsonbotCheckin
2016-06-17 19:38hudsonbotNote Added: 0087580
2016-06-17 19:38hudsonbotCheckin
2016-06-17 19:38hudsonbotNote Added: 0087581
2016-08-30 09:50hgbotCheckin
2016-08-30 09:50hgbotNote Added: 0089529
2016-08-30 14:35hudsonbotCheckin
2016-08-30 14:35hudsonbotNote Added: 0089552

Notes
(0086857)
hgbot   
2016-05-31 12:03   
Repository: erp/devel/pi
Changeset: 468a1d34cac5286b8ef079733241dafffc7e7757
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Mon May 30 15:28:06 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/468a1d34cac5286b8ef079733241dafffc7e7757 [^]

Fixed issue 33073: It was not possible to use _where param in JSON webservices

It was not possible to filter using the "_where" parameter. The "whereAndFilterClause"
parameter was needed instead.
This was not correct because in the Webservices we must mantain the use of the "_where"
parameter to filter the data.
This has been fixed in the "JSONRestServlet" class. Before calling the fetch method, the
"whereAndFilterClause" has been overwritten with the value of the "_where" parameter. Now
when a user uses "_where" in a query of a JSON webService, that value will be set in the
"whereAndFilterClause" parameter and will work properly.

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonRestServlet.java
---
(0086858)
hgbot   
2016-05-31 12:03   
Repository: erp/devel/pi
Changeset: ec9932c34210bf64b06e6087fd6e70306eff5938
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Mon May 30 17:26:21 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ec9932c34210bf64b06e6087fd6e70306eff5938 [^]

Related to issue 33073: A test has been added.

A test that checks the correct behavior has been added.

---
M src-test/src/org/openbravo/test/AllWebserviceTests.java
A src-test/src/org/openbravo/test/webservice/JSONWebServicesWhereParameter.java
---
(0086977)
alostale   
2016-06-03 09:27   
code reviewed + tested
(0087580)
hudsonbot   
2016-06-17 19:38   
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/0dc7be081b1c [^]
Maturity status: Test
(0087581)
hudsonbot   
2016-06-17 19:38   
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/0dc7be081b1c [^]
Maturity status: Test
(0089529)
hgbot   
2016-08-30 09:50   
Repository: erp/devel/pi
Changeset: 4ec29d6fd63ca7d9ed3be1367e54825329949482
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Tue Aug 30 09:49:50 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4ec29d6fd63ca7d9ed3be1367e54825329949482 [^]

Related with issue 33073: The JSONWebServicesWhereParameter test improved

This test has been improvet to avoid null pointer exceptions in the case of not getting any data in the response.

---
M src-test/src/org/openbravo/test/webservice/JSONWebServicesWhereParameter.java
---
(0089552)
hudsonbot   
2016-08-30 14:35   
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/637c22ed8e33 [^]
Maturity status: Test