Download & Extend

Domain source does not support non-editor creation of nodes.

Project:Domain Access
Version:6.x-2.0
Component:- Domain Source
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

Comments

#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

Version:6.x-2.x-dev» 6.x-2.0

#5

Status:active» needs review

Try this patch.

AttachmentSize
620596-ds.patch 814 bytes

#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

Status:needs review» fixed

OK. Committed.

#8

Status:fixed» patch (to be ported)

This (or something similar) bit the D5 version as well.

#9

Status:patch (to be ported)» needs review

Reset to a status I pay attention to.

#10

Bug confirmed--- patch reviewed and found working like a charm.

Thanx all!

#11

D5 patch.

AttachmentSize
620596-d5-source.patch 2.2 KB

#12

Committing the above and rolling 5.x.1.14 release.

#13

Status:needs review» fixed

#14

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here