Posted by restyler on March 13, 2009 at 12:31pm
4 followers
| Project: | CCK Facets |
| Version: | 6.x-1.x-dev |
| Component: | Number Facets |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Have anyone tried that?
When I try to refine by one field, I get 'no results' and strange output in 'current search' block. Check the screenshot
| Attachment | Size |
|---|---|
| facet_cck.jpg | 147.48 KB |
Comments
#1
The error can be reproduced only when you search by 'off' value of checkbox (For example I have a cck field 'kid friendly', it's a number single on/off checkbox). One node has this checkbox on, and one node has this checkbox off. So when you click on
Kid friendly (1) on search page - it works ok, but if you click on Kid friendly Off (1) - you get the error.
#2
Hi,
I also came across this same issue. Here are the things which I noticed.
Here are my observations:
For a radio button number field the allowed values are as follows:
0|No
1|Yes
1 - When it comes into
function number_facets_cck_facets_collect(&$facets, $field, $domain, $env, $arg = NULL)in case "text" the if condition
if ($number = search_query_extract($arg, $field['field_name']))breaks downbecause if $number is 0 is case of the No(0) case it won't enter the if condition which breaks down the search first.
So I changed the if condition as follows to debug it a bit further
if (is_numeric($number = search_query_extract($arg, $field['field_name'])))so that it enters the if condition.
Once it enters the if condition it breaks down again at this point
$arg = search_query_insert($arg, $field['field_name']);so on checking the search module I noticed that it checks for
if (search_query_extract($keys, $option))This again will break it down bcoz in case of the No(0) case the function
search_query_extract($keys, $option) will return a 0.
so if(0) will always fail .
I am still trying to figure a way out of this situation.
#3
Marked #450642: CCK Facets returns empty result set for “0” (zero) selection as duplicate.
#4
#5
I have committed the patch below to the Number Facets module, but you'll also need to apply the patch from #419388: search_query_insert breaks down when the value of key is 0 to get the problem solved.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.