I can use hidden field to preserve existing parameters, but I expect some problems with that.
Martial123, maybe you can use “path” urls for your application (setting ‘urlFormat’=>‘path’ for urlManager component in config\main.php)? This also solves a problem.
Can you suggest more secure way to build sql? It is a demo application, but I think some people can reproduce this vulnerable code in their applications.
I uploaded new datafilter version 0.3 and demo application: datafilter downloads.
Most important new features are: CDataFilterWidget - options to generate submit and reset buttons, CDataFilter - option to store filter state to the session.
I’m migrating legacy application and found problem using datafilter to search a column which content order no. with format OCYY/MM/NNN, the error occurs when i click on next page as follow :
[code] <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /pqc/index.php/tAG/admin/TAGFilter[TagFieldsSearch]/t.ORDERNO/TAGFilter[TagFieldsSearchText]/OC08/10/yt0/Go/TAG_page/3 was not found on this server.</p>
<hr>
<address>Apache/2.2.12 (Ubuntu) Server at domain1.com Port 80</address>
</body></html>
/code]
I notice that the problem is related to slash character use in order no. separator.
After applying filtering, or search it goes to default VIEW(that’s sites/index on default and in your demo config ‘defaultController’=>‘user/admin’,)
After selecting country(in my case organisation) and then city(in my case branch) it throws:
CDbException
Description
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'BraID' in where clause is ambiguous
Source File
C:\wamp\www\framework\db\CDbCommand.php(372)
21:17:55.734893 trace system.db.CDbCommand Querying SQL: SELECT COUNT(*) FROM `course` INNER JOIN `branch` branches ON (`course`.`BraID`=branches.`BraID`) AND (branches.OrgID = :organisationsID) WHERE BraID = :BraID
21:17:55.735400 error system.db.CDbCommand Error in querying SQL: SELECT COUNT(*) FROM `course` INNER JOIN `branch` branches ON (`course`.`BraID`=branches.`BraID`) AND (branches.OrgID = :organisationsID) WHERE BraID = :BraID
Second problem might be on my own just don’t see the possible SQL error …
Might this be because Parent PK(OrgID) is same as Child’s tables FK(OrgID)? But then why courses and branches works ok… waiting for help.
"Page not found" error means the url is incorrect. Are you sure this is related to the datafilter?
Datafilter actually adds a HTML form and submits it to the server.
Please give more details about your issue and it would be good if you reproduce this bug in some simple application (for example in datafilter demo app).
CDataFilter class has formAction property - an url for filter action. By default is is "" (empty string) which means current controller / action. So by default filter request should be sent to the controller/action where CDataFilter object is created.
You should check your WHERE conditions in the SQL code which applies filtering. Now you have "WHERE BraID = :BraID" and it should be whether "WHERE course.BraID = :BraID" or "WHERE branch.BraID = :BraID"