Transform textinput into select-field
I don't know if this is causing the error, but you're using drupal_map_assoc() wrong...

The point of that function is to take a linear array and convert it to an associative array with the values of the given array as associated keys. e.g. 

$form['distance']['search_distance']['#options'] = drupal_map_assoc(array(100, 200, 300));


I kind of suspect what you're meaning to do is this:

$form['distance']['search_distance']['#options'] = array(100 =&gt; '100 km', 200 =&gt; '200 km');


Your array is already associative, no need to try making it associative all over again :)