Problem/Motivation
Currently, the 'domain_site' grant is a global value that applies to all domains. If you have a case where 'send to all affiliates' should apply to 9 sites out of 10, you can't currently do that.
Proposed resolution
Let's make this configurable per domain, allowing sites to 'opt-out' of republishing content sent to 'all affiliates'. By default, sites would still opt-in.
Remaining tasks
Needs a hook_update_N(), a schema change {domain}.site_grant. and a test.
User interface changes
Adds a checkbox to the domain configuration form.
API changes
None that affect external modules.
Comments
Comment #1
gordon commentedYes this is something we need at ecodirectory.com.au but I found this extremely difficult, because how site_grant is checked in domain_node_grants()
which means that to not set the domain_site grant you need to unset the site_grant var.
Too unset this you need to do the following.
Firstly we really need to change how domain_node_grants() treats site_grant. Maybe do something like
Then we could implement something like...
which will turn off the site_grant for this domain.
Since I need this for a client, I am happy to provide a patch, but since this feature request is so old, I just want to make sure it will be accepted.
Comment #2
agentrickardIt needs to be fixed; it is a holdover from some very old Drupal 5 code. Another simple solution is to change the way the DEFINE is handled, which has been suggested elsewhere. Then you could set that variable in settings.php or elsewhere.
BTW: You shouldn't need to unset() the value, just set it to 0.
Comment #3
gordon commentedI would have loved to just set site_grant to 0 but the check is !empty()
Comment #4
gordon commentedHere is a patch which implements this.
Comment #5
agentrickardZero evaluates to empty. I don't get that part of the issue.
http://php.net/manual/en/function.empty.php
Comment #6
gordon commentedI have removed the empty() changes, and everything else is pretty much the same.
Comment #7
othermachines commentedI would like to see this feature. Thanks for the work on it.
There were a couple of issues with #6. I'm attaching a revised patch.
First, came across an issue related to this fix: Load $domain['site_grant'] earlier in the bootstrap process. Deleting the call to populate
$_domain['site_grant']inDOMAIN_BOOTSTRAP_FULLbrought the problem back.There were also missing single quotes around 'description' on lines 63 and 77 (see interdiff.txt).
A note that to test this patch you will need to comment out
include DRUPAL_ROOT ... domain/settings.incin settings.php, then run update.php.Comment #8
bluegeek9 commentedDrupal 7 in End of Life and no longer supported. We encourage you to upgrade to a supported version of Drupal. For more information, see https://www.drupal.org/upgrade.