Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.3.0
-
Fix Version/s: 4.5
-
Component/s: None
-
Labels:None
Description
This is 4.3 but very little code change for 4.3
Further to http://forum.civicrm.org/index.php/topic,26268.msg118498.html#msg118498 I am fairly sure the main remaining multidomain performance problem is that unnecessary group nesting is blowing out the group_contact_cache size, making it slow to rebuild. I've looked into why & where the group nesting is happening & I believe the group nesting should be made optional within core
Multisite Functionality
1) Contacts are added to domain group of the site they are created on (Core)
2) Groups are added to the domain group of the site they are created on (Core)
3) ACLs restrict access to contacts or groups based on their membership of the domain group (Multisite Extension)
The group nesting implemented by Core is leveraged by the multisite module outside of Core. The only time Group nesting is really required for contact permissioning is when a hierarchy is in place and the members of one site are automatically members of the parent site. Otherwise, the act of creating a person on the site hard-adds them to the domain group. So, group nesting makes sense but not for every group created.
Simply removing the group nesting without changing the Multisite extension would not work - as the aclGroup hook still needs to determine which groups should be visible to the user. However, i think a different mechanism would make more sense. My current thinking is that we should bring back the concept of a domain_org within the multisite extension & the multisite extension should utilise the group-create hook to create a group_organization entry for each group and use that for the ACL hook
There is only one line in core that does the group nesting : CRM_Contact_BAO_Group::create line 415
So, to go down this road would mean adding a setting to make that line optional ('multisite preference' '_no_auto_group_nesting') . I don't even think we need to worry about exposing it outside of the multisite extension for 4.3.