summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2016-02-01 00:02:45 -0500
committerDavid Rothstein <drothstein@gmail.com>2016-02-01 00:02:45 -0500
commit25512367f8b371c311454707f85e04776a528236 (patch)
tree82df82f2b093deb2e531ae4b034a6e8c505b4177
parente58060723aaade42413eab197eb43d00a9b7ec15 (diff)
downloadbrdo-25512367f8b371c311454707f85e04776a528236.tar.gz
brdo-25512367f8b371c311454707f85e04776a528236.tar.bz2
Issue #2599326 by Blanca.Esqueda, David_Rothstein: Fix autocomplete functionality on servers that are not configured to automatically recognize index.php
-rw-r--r--CHANGELOG.txt3
-rw-r--r--includes/form.inc7
-rw-r--r--modules/profile/profile.test2
3 files changed, 10 insertions, 2 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index f147e3782..e7266a339 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,9 @@
Drupal 7.42, xxxx-xx-xx (development version)
-----------------------
+- Fixed a regression introduced in Drupal 7.39 which prevented autocomplete
+ functionality from working on servers that are not configured to
+ automatically recognize index.php.
- Updated the Archive_Tar PEAR package to the latest 1.4.0 release, to fix bugs
with tar file handling on various operating systems.
- Fixed fatal errors on node preview when a field is displayed in the node
diff --git a/includes/form.inc b/includes/form.inc
index ca9b88fb3..baadcef28 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -3982,7 +3982,12 @@ function form_process_autocomplete($element) {
// browser interpreting the path plus search string as an actual file.
$current_clean_url = isset($GLOBALS['conf']['clean_url']) ? $GLOBALS['conf']['clean_url'] : NULL;
$GLOBALS['conf']['clean_url'] = 0;
- $element['#autocomplete_input']['#url_value'] = url($element['#autocomplete_path'], array('absolute' => TRUE));
+ // Force the script path to 'index.php', in case the server is not
+ // configured to find it automatically. Normally it is the responsibility
+ // of the site to do this themselves using hook_url_outbound_alter() (see
+ // url()) but since this code is forcing non-clean URLs on sites that don't
+ // normally use them, it is done here instead.
+ $element['#autocomplete_input']['#url_value'] = url($element['#autocomplete_path'], array('absolute' => TRUE, 'script' => 'index.php'));
$GLOBALS['conf']['clean_url'] = $current_clean_url;
}
return $element;
diff --git a/modules/profile/profile.test b/modules/profile/profile.test
index 6cb07391e..189247143 100644
--- a/modules/profile/profile.test
+++ b/modules/profile/profile.test
@@ -342,7 +342,7 @@ class ProfileTestAutocomplete extends ProfileTestCase {
// Autocomplete always uses non-clean URLs.
$current_clean_url = isset($GLOBALS['conf']['clean_url']) ? $GLOBALS['conf']['clean_url'] : NULL;
$GLOBALS['conf']['clean_url'] = 0;
- $autocomplete_url = url('profile/autocomplete/' . $field['fid'], array('absolute' => TRUE));
+ $autocomplete_url = url('profile/autocomplete/' . $field['fid'], array('absolute' => TRUE, 'script' => 'index.php'));
$GLOBALS['conf']['clean_url'] = $current_clean_url;
$autocomplete_id = drupal_html_id('edit-' . $field['form_name'] . '-autocomplete');
$autocomplete_html = '<input type="hidden" id="' . $autocomplete_id . '" value="' . $autocomplete_url . '" disabled="disabled" class="autocomplete" />';