Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When accessing a Drupal 8 site on a nonstandard port in a multisite environment (for instance, http://localhost:8888
), DrupalKernel fails to suggest some appropriate aliases from sites.php
(in this case, 8888.localhost
). As a result, this functionality does not work as documented.
Proposed resolution
Use Symfony\Component\HttpFoundation\Request::getHttpHost() instead of Symfony\Component\HttpFoundation\Request::getHost() when determining the hostname.
Comment | File | Size | Author |
---|---|---|---|
#9 | 2410019.9.patch | 7.54 KB | alexpott |
#9 | 3-9-interdiff.txt | 653 bytes | alexpott |
#3 | 2410019.3.patch | 7.54 KB | alexpott |
#3 | 2410019.3.test-only.patch | 6.99 KB | alexpott |
#1 | 2410019-multisite-1.patch | 560 bytes | dstelljes |
Comments
Comment #1
dstelljes CreditAttribution: dstelljes commentedComment #2
MegaChriz CreditAttribution: MegaChriz commentedPatch still applies and I can confirm that it fixes the issue.
Comment #3
alexpottThis is a nice find. I decided to investigate if we can add unit test coverage using the virtual file system in PHPUnit/VfsStream and we can.
The test only patch is also the interdiff. The patch renames DrupalKernelTrustedHostsTest to be DrupalKernelTest so it can test more stuff that just the trusted hosts methods.
Comment #5
dawehnerYou have written to much yaml
OOH
Comment #6
alexpott@dawehner thanks for the review
#5.1 Not from this patch twas part of DrupalKernelTrustedHostsTest - which I renamed to DrupalKernelTest
Comment #7
dawehnerOkay, fair
Comment #9
alexpottRerolled - conflicted with #2494319: Follow up to Spellchecking Drupal - Comments. Setting back to rtbc as per #7.
Comment #10
catchpaterns. This was a copy/paste issue (typo already in HEAD), and I fixed it on commit.
Committed/pushed to 8.0.x, thanks!