Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Dashboard domain ID is set even when passed as a param #15282

Merged
merged 1 commit into from
Sep 12, 2019

Conversation

christianwach
Copy link
Member

Overview

Follows on from #15099 by fixing the identification of a Dashlet to update when domain_id is specified as a param when creating a Dashlet.

Before

When a Dashlet with name = 'blah' already exists, then attempting to create a new one with a different domain_id updates the existing one rather than creating a new Dashlet. This only occurs when domain_id is passed as a param.

// Construct params.
$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 );

After

The code above correctly creates a Dashlet with the domain_id specified in the params.

@civibot
Copy link

civibot bot commented Sep 11, 2019

(Standard links)

@civibot civibot bot added the master label Sep 11, 2019
@seamuslee001
Copy link
Contributor

Change makes sense to me merging

@seamuslee001 seamuslee001 merged commit c58df6e into civicrm:master Sep 12, 2019
@christianwach christianwach deleted the lab-1200-2 branch September 12, 2019 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants