List Filter via URL Issue

Status
Not open for further replies.
I can't replicate this one.
Here's my test query:

Code:
http://localhost:81/fabrik31x/public_html/index.php/test-list?&resetfilters=1&fabrikdebug=1&test___country_id_raw[value]=1&test___country_id_raw[join]=or&test___region_id_raw[value]=2&test___region_id_raw[join]=or&test___region_id_raw[grouped_to_previous]=1&test___sex=male&test___button=

which generates this where statement (I'm testing using fabrikdebug=1 in the query)
Code:
WHERE ( ( `test`.`country_id` = '1' or `test`.`region_id` = '2') AND (`test`.`sex` = 'male' OR `test`.`sex` LIKE '[\"male\"%' OR `test`.`sex` LIKE '%\"male\"%' OR `test`.`sex` LIKE '%\"male\"]') AND `test`.`button` = '' ) ORDER BY `test`.`label` DESC

using the list nav to go to the next page the URL is:

Code:
http://localhost:81/fabrik31x/public_html/index.php/test-list?resetfilters=0&fabrikdebug=1&clearordering=0&clearfilters=0
and the where query is

Code:
WHERE ( `test`.`button` = '' AND ( `test`.`country_id` = '1' or `test`.`region_id` = '2') AND (`test`.`sex` = 'male' OR `test`.`sex` LIKE '[\"male\"%' OR `test`.`sex` LIKE '%\"male\"%' OR `test`.`sex` LIKE '%\"male\"]') )

The order of the filters has changed, but the query results should be the same as the OR and "group by" options are still respected.
 
I don't know what to say Rob. It looks like your test case is good. I can't tell though what element types you used though if that might matter. All the elements in my query are databasejoin and looking at the value. Here is what I see following the steps you have above. I just updated to the latest GitHub.

Example URL (line breaks added for clarity)
http://www.mypoolstats.com/
index.php?option=com_fabrik&view=list&listid=33&resetfilters=1&fabrikdebug=1
&mps_fargo_matches___p1_raw[value][]=29
&mps_fargo_matches___p1_raw[join][]=OR
&mps_fargo_matches___p2_raw[value][]=29
&mps_fargo_matches___p2_raw[join][]=OR
&mps_fargo_matches___p2_raw[grouped_to_previous][]=1
&mps_fargo_matches___table_id_raw[value][]=1
&mps_fargo_matches___game_id_raw[value][]=1

Corresponding WHERE query
WHERE ( ( `mps_fargo_matches`.`p1` = '29' OR `mps_fargo_matches`.`p2` = '29') AND `mps_fargo_matches`.`table_id` = '1' AND `mps_fargo_matches`.`game_id` = '1' )

URL after page nav

Broken WHERE query - the red colored OR should be AND
WHERE ( `mps_fargo_matches`.`table_id` = '1' AND `mps_fargo_matches`.`game_id` = '1' OR ( `mps_fargo_matches`.`p1` = '29' OR `mps_fargo_matches`.`p2` = '29') )

I did notice my test URL contains "[]" before the equals signs that yours does not. I tried without those but still see the same behavior.
 
try setting:

&mps_fargo_matches___p2_raw[join][]=OR

to

&mps_fargo_matches___p2_raw[join][]=AND

?
 
Rob, your suggestion gives
WHERE ( ( `mps_fargo_matches`.`p1` = '29' AND `mps_fargo_matches`.`p2` = '29')

which is not desired.

However, it inspired me to tinker with the URL format. I removed
&mps_fargo_matches___p1_raw[join][]=OR

entirely which still gives the desired
WHERE ( ( `mps_fargo_matches`.`p1` = '29' OR `mps_fargo_matches`.`p2` = '29') AND `mps_fargo_matches`.`table_id` = '1' AND `mps_fargo_matches`.`game_id` = '1' )

and this after page nav or changing display number
WHERE ( `mps_fargo_matches`.`table_id` = '1' AND `mps_fargo_matches`.`game_id` = '1' AND ( `mps_fargo_matches`.`p1` = '29' OR `mps_fargo_matches`.`p2` = '29') )

Like before, the ordering of the criteria changes but the logic is the same. So this issue is solved!!!

To summarize, the working URL format is

index.php?option=com_fabrik&view=list&listid=33&resetfilters=1
&mps_fargo_matches___p1_raw[value][]=29
&mps_fargo_matches___p2_raw[join][]=OR
&mps_fargo_matches___p2_raw[value][]=29
&mps_fargo_matches___p2_raw[grouped_to_previous][]=1
&mps_fargo_matches___table_id_raw[value][]=1
&mps_fargo_matches___game_id_raw[value][]=1
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top