Incorrect form_ser_error

vflirt - November 4, 2008 - 11:37
Project:Sphinx (Sphinx search integration)
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

When validating the search form with "sphinx_search_form_validate" , you are setting the error :
form_set_error($form_state['values']['searchstring'], t('You must enter a search string'));
This is incorrect as form_set_error expects the first argument to be the name of the field:
http://api.drupal.org/api/function/form_set_error :
form_set_error($name = NULL, $message = '', $reset = FALSE)
$name The name of the form element. If the #parents property of your form element is array('foo', 'bar', 'baz') then you may set an error on 'foo' or 'foo][bar][baz'. Setting an error on 'foo' sets an error for every element where the #parents array starts with 'foo'.

#1

johsw - November 14, 2008 - 22:58
Status:active» fixed

Fixed in next release.

#2

System Message - November 28, 2008 - 23:02
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.