svn commit: r1693579 - /ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1693579 - /ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy

jleroux@apache.org
Author: jleroux
Date: Fri Jul 31 11:56:58 2015
New Revision: 1693579

URL: http://svn.apache.org/r1693579
Log:
A solution from Gareth Carter for "Wrong percent encoding in Webtool/SQL Processor" https://issues.apache.org/jira/browse/OFBIZ-6567

This was reported by Gareth Carter;

If for instance you use this SQL expression
    select * from Party_Role where role_Type_Id LIKE  '%CA%'
It will be interpreted (and returned to UI) as
   select * from Party_Role where role_Type_Id LIKE  'Ê%'
And no result will be returned when OOTB there is  6 <PartyRole partyId="***" roleTypeId="CARRIER"/> entities

The solution is to keep the SQL expression string from the context at the top of the EntitySQLProcessor.groovy script and put it back in context after the request call (at bottom)

Modified:
    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy?rev=1693579&r1=1693578&r2=1693579&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy Fri Jul 31 11:56:58 2015
@@ -26,6 +26,8 @@ import java.util.Iterator;
 import org.ofbiz.entity.*;
 import org.ofbiz.entity.model.ModelGroupReader;
 
+sqlCommand = context.request.getParameter("sqlCommand");
+
 resultMessage = "";
 rs = null;
 columns = [];
@@ -74,3 +76,4 @@ context.groups = groups;
 context.resultMessage = resultMessage;
 context.columns = columns;
 context.records = records;
+context.sqlCommand = sqlCommand; // (see OFBIZ-6567)