Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.I noticed that form autocomplete widget uses absolute URL's. As far as I know, this behavior exists since D6 and it seems to be unchanged code because no one really care about this.
It seems that this absolute URL is inconsistent with core behavior: core generates relative URL for almost everything else (except files, another issue, and feeds, which is normal).
This absolute URL can break some sites behind proxies, and will generate potentially wrong caches (may be not for forms, but it still could in some weird edge cases).
If autocomplete doesn't work in relative, no URL at all will work in relative, so I'm asking why this particular URL is generated as an absolute URL? Is there or was there real problems when this code as been originally written more than 4 years ago? If so, this is undocumented today.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 1199878-relative_autocomplete_url-8.x-11.patch | 573 bytes | xen |
| #7 | 1199878-relative_autocomplete_url-8.x-3.patch | 1.79 KB | pounard |
| #4 | 1199878-relative_autocomplete_url-8.x-2.patch | 640 bytes | pounard |
| #4 | 1199878-relative_autocomplete_url-7.x-2.patch | 640 bytes | pounard |
| #4 | 1199878-relative_autocomplete_url-6.x-2.patch | 823 bytes | pounard |
Comments
Comment #1
pounardAttached patches for D8, D7 and D6 that reverts autocomplete URL to be relative instead of absolute.
EDIT: Better patches would be to removed completely the 'absolute' options for url() call. Then it'll use system default instead of forcing it to false. Because url() function doesn't seems to care about any kind of system default and will generate in relative if not specified, this won't (probably) not alter the behavior except if some hard rewriting by modules is being done.
Comment #2
catchYou should definitely drop the 'absolute' => FALSE, that's the default in all versions. I can't imagine why this would be an absolute URL off the top of my head.
Comment #3
pounardThanks for feedback, first since 2008 :) I'm going to redo my patches.
Comment #4
pounardNew patches.
Comment #6
pounardThe problem seems to be the test itself, I should fix it
, this won't be tonight!Comment #7
pounardComment #9
xen commented#7: 1199878-relative_autocomplete_url-8.x-3.patch queued for re-testing.
Comment #11
xen commentedRerolled against HEAD. The fixup of the profile.module test is gone as the module is.
Comment #12
pounardNice, thanks. It took for 4 for a 2 lines patch to pass! ^^
Comment #15
alansaviolobo commentedComment #16
risse commentedAutocompletion system has completely changed in Drupal 8, so no changes are needed anymore.