Skip to content

Commit

Permalink
Prevent adding duplicate dashlet if present with same name and label
Browse files Browse the repository at this point in the history
  • Loading branch information
monishdeb committed May 17, 2021
1 parent 86cbdb2 commit cc20fdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CRM/Core/BAO/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ 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']) || !empty($params['label'])) {
$dashlet->name = $params['name'] ?? NULL;
$dashlet->url = $params['url'] ?? NULL;
$dashlet->url = $params['label'] ?? NULL;
$dashlet->find(TRUE);
}
}
Expand Down

0 comments on commit cc20fdd

Please sign in to comment.