i am looking at the new search form that comes with ZP 1.4. i should start with the fact that i really love the fact that we can easily refine search results by just entering a new term in the form.
in the search option panel (admin back-end) we can select the fields on which the search should be performed. these fields are then listed in the `searchextrashow` list. they used to be checked by default but there are not anymore. the search itself is still working. this might be confusing for users because if nothing is checked the search should just return nothing.
anyway i think this comes from somewhere around line 4177 of the `template-functions.php` file (`printSearchForm` function). there is a mismatch between the `$key` values and the `$query_fields` values. if one replaces `$key` by `$display` in the `in_array` call (line 4179) then it works but i am not sure this is the way to do it.
frank
Comments
Regarding the code. `$fields` will have the values from the back end. `$query_fields` value may come from a number of places.
1. as a passed paremeter to the `printSearchForm()` function. If no parameter was passed, then
2. the possibility of these values existing from a previous search is examined. If there are such, they are used. If not, then
3. this variable is set the same as the `$fields` variable.
The test for `$key` being in the `$query_fields` array will tell us if that field was "checked" in a previous life (see above.) Certainly in case 3 the key must be in the array since the arrays are identical. In case 2 the key will be in the array if the previous search had selected that field. In case 1, only the writer of the function call can know.
now in zenpage the call to the search form is done with `printSearchForm("","search","",gettext("Search gallery"))`. in fact if i do the same call within my theme it works as expected. the thing is i want to use my own reset icon and for this i need to put more options in the function call. here is what i did
`printSearchForm( '','searchform','',gettext('SEARCH'),"$_zp_themeroot/images/search-drop.png",'','',"$_zp_themeroot/images/search-reset.png" )`.
writing this post i realize i should have written `printSearchForm( '','searchform','',gettext('SEARCH'),"$_zp_themeroot/images/search-drop.png",`NULL`,`NULL`,"$_zp_themeroot/images/search-reset.png" )`. and of course with the function properly called, it works just fine even with my own reset icon.
mea culpa !