Download & Extend

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:closed (duplicate)

Issue Summary

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.

AttachmentSize
domain_user_default.module.patch959 bytes

Comments

#1

Status:active» postponed (maintainer needs more info)

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

Status:postponed (maintainer needs more info)» closed (duplicate)

See #463034: Using Domain User Default with Domain Access 2.x version

nobody click here