From: Monish Deb Date: Mon, 17 May 2021 12:33:20 +0000 (+0530) Subject: Prevent adding duplicate dashlet if present with same name and label X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8f7fd7449b9e36703e684eb0fd0334215fb09251;p=civicrm-core.git Prevent adding duplicate dashlet if present with same name and label --- diff --git a/CRM/Core/BAO/Dashboard.php b/CRM/Core/BAO/Dashboard.php index 0a311bce74..c5ade57f4a 100644 --- a/CRM/Core/BAO/Dashboard.php +++ b/CRM/Core/BAO/Dashboard.php @@ -233,9 +233,8 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { $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); } }