diff --git a/booking.regn_form.inc b/booking.regn_form.inc index 9d7dd19..c6a4a19 100644 --- a/booking.regn_form.inc +++ b/booking.regn_form.inc @@ -70,6 +70,13 @@ function booking_register_page() */ function _booking_ecclesia_name_autocomplete($string = "") { $matches = array(); + + if ($string === "") { + // Return empty result to the form in json + drupal_json_output($matches); + return; + } + $sanitised_string = preg_replace("/[^a-zA-Z0-9\s\.']/", '', $string); $sanitised_string .= "%"; //watchdog('booking_debug', "
Autocomplete checking for ecclesia matching:\n@info", array('@info' => print_r($sanitised_string, true)));