First off, thank you for writing this nice little module. I've found it very helpful. I'd like to talk with you all about adding a small feature to extend it's use. First, I'll describe how I've modified the module to meet my use case, then I'd like to discuss how I might submit a patch that abstracts this feature to be of more general purpose use.
My Use Case:
I've got a default site at www.mysite.org and a community site at community.mysite.org. Site visitors with the "member" role can add content that should be published to the community site. I'd like them to be able to do so from either www.mysite.org or community.mysite.org. In order to do so, I have to give them Domain Access's "publish to any assigned domain" permission.
I'm using your module to set the default domain for this content to the community site. (Actually, it's a bit more complicated than that, b/c they publish to both domains - depending upon the type of content.) In order to avoid confusion, I do /not/ want to display the domain content publishing fieldset on the node edit form. It's just not necessary - given that I'm using your module to properly assign the domain per content type.
To accomplish this, I've changed the following:
if (!empty($default_domains)) {
$form['domain']['domains']['#default_value'] = $default_domains;
}
to:
if (!empty($default_domains)) {
$form['domain']['domains']['#default_value'] = $default_domains;
}
if (!user_access('set domain access')) {
$form['domain']['#access'] = FALSE;
}
in your hook_form_alter.
This seems to work for me, though, I don't like the dependency on esoteric permissions configuration. That said, your module is already somewhat dependent upon some less-than-straight-forward configuration settings (No offense, all Domain Access contribs seem to be...), in that "publish to any assigned domain" must be enabled for your module to work.
Thoughts? How could we abstract some of this a bit better? Rather than making the display of the domain field set on the node edit form be based upon permissions, should it be a configuration setting at /admin/build/domain/settings? Or should it be it's own permission?
Thanks in advance for your thoughts. Again, thanks a ton for your work on this tool!
Cheers,
Sean Larkin
ThinkShout.com
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | enforce.patch | 2.75 KB | burgs |
Comments
Comment #1
zserno commentedI think displaying domain access fieldset on a node form has no business with this module. hook_form_alter() is only implemented to apply settings to a newly created node, defined in it's content type.
Normally in a simple domain access setup this fieldset's visibility should be controlled by "set domain access" permission.
Maybe you have other domain related modules enabled that overwrite this permission and show the fieldset?
Maybe I don't understand your question. In this case feel free to ask more. :)
Comment #2
zserno commentedDue to lack of activity, I consider this as fixed. Feel free to reopen in case you need.
Comment #4
burgs commentedI think this functionality would be great to implement, on a non-permissions level.
What I would ideally like to be able to do is:
1. Content Type 1 is always published to subdomain x.example.org
2. Content Type 2 has a default of x.example.org but can be changed on the node edit/add form
3. Content Type 3 has no default and can be changed on the node edit/add form
With the help of this module currently options 2 and 3 work nicely. Option 1 is the issue.
I think adding a third option to the settings on the edit content type form to read:
-disabled
-enabled
-enforced
Sound feasible?
Comment #5
burgs commentedOk, I've worked a patch based on my desires mentioned in #4.
This adds an enforce option to the nodetype edit form, and then will hide that type and enforce it on the node add/edit form.