CRM-19842-Can't delete a dedupe rule
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 19 Jan 2017 10:43:10 +0000 (16:13 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 19 Jan 2017 10:43:10 +0000 (16:13 +0530)
CRM/Contact/Page/DedupeRules.php

index 9f2358e4408ad29f5d3f23c9fe2acb4c64496a34..151dcdf58eaafe757b6dc2bbd4e37b7c14419f5f 100644 (file)
@@ -215,7 +215,11 @@ class CRM_Contact_Page_DedupeRules extends CRM_Core_Page_Basic {
 
     $rgDao = new CRM_Dedupe_DAO_RuleGroup();
     $rgDao->id = $id;
-    $rgDao->delete();
+    if ($rgDao->find(TRUE)) {
+      $rgDao->delete();
+      CRM_Core_Session::setStatus(ts("The rule '%1' has been deleted.", array(1 => $rgDao->title)), ts('Rule Deleted'), 'success');
+      CRM_Utils_System::redirect(CRM_Utils_System::url($this->userContext(), 'reset=1'));
+    }
   }
 
 }