Domain source does not support non-editor creation of nodes.
RoboPhred - November 2, 2009 - 01:50
| Project: | Domain Access |
| Version: | 6.x-2.0 |
| Component: | - Domain Source |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | fixed |
Description
I am trying to allow users to create content on the domains, but I do not want them to choose a domain; the source domain should be the one the user is currently on.
When a user creates a content type, this warning is thrown:
warning: array_merge() [function.array-merge]: Argument #1 is not an array in sites/all/modules/domain/domain_source/domain_source.module on line 150.
warning: in_array() [function.in-array]: Wrong datatype for second argument in sites/all/modules/domain/domain_source/domain_source.module on line 157.
The source affiliate must be selected as a publishing option.The current domain should be used as source for the content by default, even if the user cannot modify the domain settings.

#1
I found the cause in domain_source_nodeapi
<?php
if (!empty($node->domains)) {
$allowed = $node->domains;
}
if (!empty($node->domains_raw)) {
$allowed = array_merge($node->domains, $node->domains_raw);
}
?>
here, $allowed is set to $node->domains if $node->domains is not empty. However, if $node->domains_raw is not empty, $node->domains is still used directly. I assume this should be $allowed instead.
<?php
if (!empty($node->domains)) {
$allowed = $node->domains;
}
if (!empty($node->domains_raw)) {
$allowed = array_merge($allowed, $node->domains_raw);
}
?>
#2
I had the same problem on my site, the fix in post#1 solves this issue.
#3
Yes, and we need to make sure $allowed is set to an array before doing the merge.
We should probably use $allowed += $node->domains_raw; here.
#4
#5
Try this patch.
#6
patch works for me except when applying from within the overall domain directory, it can't find the correct file to patch. had to manually enter 'domain_source/domain_source.module'. then it worked fine.
#7
OK. Committed.
#8
This (or something similar) bit the D5 version as well.
#9
Reset to a status I pay attention to.
#10
Bug confirmed--- patch reviewed and found working like a charm.
Thanx all!
#11
D5 patch.
#12
Committing the above and rolling 5.x.1.14 release.
#13