Picking domain by content type error

tullnet - February 3, 2007 - 10:41
Project:Multiple Domains
Version:5.x-1.x-dev
Component:url rewrite functionality
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I found that it wasn't picking the correct domain to use when trying to set it up by content type.
eg

domain 'fred.domain.com' set to be used for content type 'fred'
domain 'bob.domain.com' set to be used for content type 'bob'

Instead, it was just using the first domain.

Fixed it by changing:

$page_match = $page_match || in_array($node->type, array_keys($info['types']));

to
$page_match = $page_match || in_array($node->type, array_keys($info['types'],!"0"));

Seems to work now!

#1

levavie - February 24, 2007 - 22:44

Try the following use-case:

First check several relevant content types, then un-check them.

The $info['types'] array (and the multidomain_sites variable on the variable table) will still contain numeric entities for the unchecked domains.

Conclusion: there is a bug in the content type selection mechanism.

#2

levavie - February 24, 2007 - 22:46

Continued:

On my case the array contained two extra entities - '0' and '1'.

Workaround: When I've deleted the relevant domain and re-added it, the array was OK and hence not every URL was routed to the domain, just the relevant ones.

#3

levavie - February 24, 2007 - 22:47
Status:needs review» active
 
 

Drupal is a registered trademark of Dries Buytaert.