@agentrickard Thanks for your comment, it helped me figure this out. Here's how I'm saving my nodes. The comments explain which parts of the node edit form each of the node properties relate to.
// Set domain access:
$node->domain_site = FALSE; // Sets "Send to all affiliates" off
$node->domain_source = $domain_id; // Sets the "Source domain"
$node->domains = array($domain_id => $domain_id); // Sets the domains node is published to.
Comments
Comment #1
agentrickardThe -1 is because you can't use 0 with checkboxes. This piece of hilarity was removed from 7.x.3, so there you do this:
See
domain_node_access_records()for the save logic.Comment #2
rangi500 commented@agentrickard Thanks for your comment, it helped me figure this out. Here's how I'm saving my nodes. The comments explain which parts of the node edit form each of the node properties relate to.
// Set domain access:
$node->domain_site = FALSE; // Sets "Send to all affiliates" off
$node->domain_source = $domain_id; // Sets the "Source domain"
$node->domains = array($domain_id => $domain_id); // Sets the domains node is published to.
// Save node:
node_save($node);
Comment #3
agentrickard