Download & Extend

Use this domain for the following types of posts

Project:Multiple Domains
Version:5.x-1.x-dev
Component:code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

I might have missed something so this may be irrelevant. My initial interpretation of the modules behavior was that if I checked a node type under the heading "Use this domain for the following types of posts" for a specific domain then that node type would only show up on the parent domain and the child domain being edited. This functionality did not appear to work in our tests. All nodes would appear on all sites. In order to remedy this the attached patch was written to add a multidomain_db_rewrite_sql function to only select the content types that have been designated in the multidomain admin.

AttachmentSize
multidomain_0.patch1.3 KB

Comments

#1

Status:active» needs review

Updating Status to indicate a patch is attached.

#2

The current behaviour is that links - but not node visibility - are controlled by the node type selects.

Adding in node visibility as you've done is a good idea. I've done something similar in the patch for assigning content to a domain based on taxonomy, see http://drupal.org/node/138042.

Possibly this should be a configuration option, as there may be cases where this isn't desired.

#3

Our client authorized contributing this back to the community so here is a patch that enables this functionality as a configurable option in admin/settings/multidomain/settings ... would be great if it gets included in your module as this has been a critical component for the work we performed.

AttachmentSize
mdomainpatch.patch 2.08 KB

#4

Status:needs review» needs work

I support this patch.

Since http://drupal.org/node/138042 was applied, there is an existing multidomain_db_rewrite_sql() function in the DRUPAL-5 branch (the branch under active development), so this patch needs to be integrated into that function.

It should follow the same approach as was done for taxonomy. Specifically, defines are used to make the rewriting configurable.

#5

I believe this will provide what you request.

AttachmentSize
multidomain_1.patch 2.85 KB

#6

Looks mostly correct.

Suggestions:

1. Instead of introducing a new DEFINE, rename the existing ones. E.g.,

MULTIDOMAIN_TAXONOMY_REWRITE_NONE should become MULTIDOMAIN_SQL_REWRITE_NONE

And use the same defines for both taxonomy and node type rewriting.

2. Use a parallel variable name and the same sort of radios for node types as used for taxonomy. The variable name then should be 'multidomain_node_type_rewrite_sql'.

3. I don't see the configuration variable actually used in the current patch. $filter_type is set in multidomain_rewrite_sql() but not tested.