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.
I found by accident that if you put spaces between the comma in the domain input field then the space causes a failed comparison in the code and thus is not triggered.
In the function locale_language_multidomain()
Remove the spaces from the store valu string before exploding
Old code:
$hosts = array();
foreach (explode(',', $language->domain) as $host) {
New code:
$hosts = array();
$domainListStr = $language->domain;
$domainListStr = str_ireplace(" ", "", $domainListStr); //remove spaces
foreach (explode(',', $domainListStr) as $host) {
Comment | File | Size | Author |
---|---|---|---|
#1 | if_domains_have_spaces-2228589-1.patch | 1.15 KB | silvi.addweb |
Comments
Comment #1
silvi.addweb CreditAttribution: silvi.addweb at AddWeb Solution Pvt. Ltd. commentedThe module works well if you do not add any space between domain names and comma. No patch needed for that.
However, it would be good to check for spaces in anycase. Attached patch checks for spaces and removes it if they are present.