Commit b03e282d authored by Dom.'s avatar Dom.

Issue fixed: callback with absolute URL did not save properly.

parent 4bb07dd5
......@@ -296,16 +296,16 @@ function search_autocomplete_form_configure_submit($form, &$form_state) {
$callback = $values['callback_textfield'];
// Static resource => type = 2.
$data_type = $values['suggestions'];
if ($data_type == 'callback' && $callback != '') {
// If path is absolute:
if (url_is_external($callback)) {
// If path is internal:
if (strcmp(substr($callback, 0, strlen($base_url)), $base_url) === 0) {
// Get it relative.
$callback = str_replace($base_url . "/", "", $callback);
}
}
}
// if ($data_type == 'callback' && $callback != '') {
// // If path is absolute:
// if (url_is_external($callback)) {
// // If path is internal:
// if (strcmp(substr($callback, 0, strlen($base_url)), $base_url) === 0) {
// // Get it relative.
// $callback = str_replace($base_url . "/", "", $callback);
// }
// }
// }
// In the case of view, we use a custom callback to retrieve the view data.
if ($data_type == 'view') {
$callback = 'search_autocomplete/autocomplete/' . $values['fid'] . '/';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment