CiviCRM Dashboard does not respect multiple domains
When I create a new Domain (conveniently done via the API as provided by the
org.civicrm.multisite Extension but not limited to that method, the same happens when this is done manually) I have noticed a couple of problems:
- When I visit the CiviCRM Dashboard, I see duplicate Dashlets (FYI "Call Next" is mine):
- When I try to create a new Dashlet on the new Domain:
$params = array( 'domain_id' => CRM_Core_Config::domainID(), 'name' => 'blah', 'label' => E::ts( 'Blah' ), 'url' => 'civicrm/blah', 'fullscreen_url' => 'civicrm/blah?context=dashletFullscreen', 'permission' => 'access CiviCRM', 'is_active' => 1, 'cache_minutes' => 1, ); // Create dashlet. $dashlet = civicrm_api3( 'Dashboard', 'create', $params );
What happens with the above code is that the API updates the existing Dashlet with the new
domain_id instead of creating a new Dashlet for that Domain.
The result of this is that it's impossible for a Contact to have different Dashlets per Domain.
PR to follow.