Redirection from any subdomain does not work for root domain
| Project: | Domain User Default |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | duplicate |
Jump to:
I set up two users:
- user A with the root domain (domain A) as the default domain
- user B with a test domain (domain B) as the default domain
Having selected the option to redirect the user to their default domain from any subdomain other than the user's default, it worked fine when I logged in as user B on domain A, but not as user A on domain B: the redirection did not work for the one with the root domain as the default value.
This is because of the way the domain id is actually stored in the global as 0 rather than -1, and if you check out the source to domain_content.admin.inc between lines 181-184, you'll see that it's converted back to 0 before the domain lookup to get the valid domain data.
<?php
// The root domain is stored as -1, but cast as zero in the global variable.
$key = ($domain == -1) ? 0 : $domain;
// Convert the domain ids to data so we can print them.
$node_domains[] = domain_lookup($key);
?>I've created a patch that fixes this issue in a similar manner for Domain User Default. I've tested it and it works fine now.
| Attachment | Size |
|---|---|
| domain_user_default.module.patch | 959 bytes |

#1
Which version of Domain Access are you using? 1.0 or 2.0 branch?
#2
I'm using the 2.0 branch, specifically 6.x-2.0-rc6 at the moment.
#3
See #463034: Using Domain User Default with Domain Access 2.x version