Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.0.0alpha1
-
None
-
PHP Version: 5.2.6
Description
The syntax described in documentation (the version thath was aimed for eZ find 1.1 however) for filtering on ezfind fetch doesn't seem to be valid any more in eZ find 2.0.
The document describes on page 12 that filter option may be a string or an array:
A filter is specified by <class_identifier>/<class_attribute>[/<sub_structure]:<value>. The filter option may be a string or list of strings.
However, giving a string as done in the example just doesn't work:
Example: fetch( ezfind, search, hash( query, 'eZ Systems', filter, 'car/in_stock:1' ) )
This will only work if filter definition is given in an array. Indeed, it seems that it comes from the solr query builder, that expects for an array on his treatment (in method buildsearch). The attached patch can get around this case and allows to use a string filter definition.
Steps to reproduce
- In a search template (for an example advancedsearch.tpl), define your search to use ezfind fetch with a string-typed filter:
{set $search=fetch(ezfind,search, hash( query,$search_text, filter,'<class>/<attribute>:<filter_value>' ))}
- This should end as a non working filter, you will have to use a filter like
{set $search=fetch(ezfind,search, hash( query,$search_text, filter,array('<class>/<attribute>:<filter_value>') ))}
to make it work, although the documentation seemed to allow the string syntax