Skip to content

Commit

Permalink
Merge pull request #20375 from JMAConsulting/core-65
Browse files Browse the repository at this point in the history
Prevent adding duplicate dashlet if present with same name and label
  • Loading branch information
colemanw authored Jun 3, 2021
2 parents e3aaef4 + 8f7fd74 commit 8d4d542
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions CRM/Core/BAO/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@ public static function addDashlet(&$params) {
$dashlet->domain_id = $params['domain_id'] ?? CRM_Core_Config::domainID();

// Try and find an existing dashlet - it will be updated if found.
if (!empty($params['name']) || !empty($params['url'])) {
if (!empty($params['name'])) {
$dashlet->name = $params['name'] ?? NULL;
$dashlet->url = $params['url'] ?? NULL;
$dashlet->find(TRUE);
}
}
Expand Down

0 comments on commit 8d4d542

Please sign in to comment.