Prevent adding duplicate dashlet if present with same name and label
authorMonish Deb <monish.deb@jmaconsulting.biz>
Mon, 17 May 2021 12:33:20 +0000 (18:03 +0530)
committerMonish Deb <monish.deb@jmaconsulting.biz>
Wed, 2 Jun 2021 03:23:27 +0000 (08:53 +0530)
CRM/Core/BAO/Dashboard.php

index 0a311bce74b9e9a149968ea818170add991df9b9..c5ade57f4a493f4424c8f50c129a4de5d01201ad 100644 (file)
@@ -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);
       }
     }