Thanks for creating this module.
I installed this on a dev setup and ran into some issues, especially around pages being published to all sites (eg. 'sent to all affiliates'). So I've made some fixes, see attached patch.
The changes I've made are:
1. Call node_access_needs_rebuild() when enabling the module, or else its changes don't come into effect.
2. Including the 'domain_site' grant as if it were a regular domain site with id = 0. I ran into the issue with the grants gid, as a domain id of 0 formed a combined gid of '0099901', which when entered into the db as an integer became 99901. So I've changed the encoding of the gid to include the separator at the beginning in addition, and have changed the separator to just 999. This stops us losing information due to integer conversion and leading zeros.
3. I've modified some of the logic. In particular, I'm deleting the records from entering the node_access table if we're handling a particular node's access. This then simplifies the logic in hook_node_grants_alter(),
4. And some general code cleanup, eg. replace if/elseif/else with switch, break out large array literals over several lines.
There may still be some issues, but my little bit of testing came out fine.
| Comment | File | Size | Author |
|---|---|---|---|
| diff.patch | 5.1 KB | torrance123 |
Comments
Comment #1
torrance123 commentedI've made several changes since to the code — that patch is now out of date.
Please see https://github.com/torrance/domain_og_bridge where I've 'forked' your code. Happy to push it back into module if you've got the time to maintain it.