Commit c30dc333 authored by David Lesieur's avatar David Lesieur

Fixed empty result set when search key value is "0" (quoted).

parent 362c39bb
......@@ -20,12 +20,10 @@ function text_facets_cck_facets_collect(&$facets, $field, $domain, $env, $arg =
case 'text':
// Scan the given search text for a '{field_name}:"{value}"'
// token, and create facets from it.
if ($found_text = faceted_search_quoted_query_extract($arg, $field['field_name'])) {
if (!empty($found_text)) {
// Create an active facet with the value found in the search text.
$category = new cck_facet_category($field, $found_text);
$facets[] = new text_facet($field, array($category));
}
if (!is_null($found_text = faceted_search_quoted_query_extract($arg, $field['field_name']))) {
// Create an active facet with the value found in the search text.
$category = new cck_facet_category($field, $found_text);
$facets[] = new text_facet($field, array($category));
// Remove the parsed text
$arg = faceted_search_quoted_query_insert($arg, $field['field_name']);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment