- ๐บ๐ฆUkraine gilmord ๐บ๐ฆUkraine
Just faced this issue - I only need domain_access for users, all the content is shared between domains. I have deleted the fields but node_access table is still full of grants.
There is no built option to disable this module for content, content is locked to the active or default domain. According to attached issue I have to grant nodes to all domains which will make useless access checks as it always should be accessible.
I would say a propper option here is to disable grants and access records hooks so if domain_access is not needed for content it can be disabled.
- ๐บ๐ฆUkraine gilmord ๐บ๐ฆUkraine
For now, I have just disabled the hooks, works well so far.
/** * Implements hook_module_implements_alter(). */ function YOUR_MODULE_module_implements_alter(&$implementations, $hook) { // Before the issue is resolved we disable access hooks // to allow content in all domains. // @see: https://www.drupal.org/project/domain/issues/3047514 $disable_hooks = [ 'node_access_records', 'node_grants', ]; if (in_array($hook, $disable_hooks) && isset($implementations['domain_access']) ) { unset($implementations['domain_access']); } }
- Status changed to Active
11 months ago 5:04pm 24 January 2024 - ๐บ๐ฆUkraine gilmord ๐บ๐ฆUkraine
In any case this does not seem to be a good approach to force domains. Imagine having millions of nodes and only small part of it is domain-restricted - node_access table will be flooded with millions of useless records. If there are translations - the number will be doubled/tripled/etc
I think this issue should be handled and it should not work like that by design.