Remove reference to constants in dedupe rule ajax (which is yuck)
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 6 Sep 2022 01:16:24 +0000 (13:16 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 6 Sep 2022 01:16:24 +0000 (13:16 +1200)
CRM/Contact/Page/AJAX.php

index 2529fcaf1169a4f109cb954618d264f0e40246ff..dfe05659bcd4c156999a1cef5584dffbbdba748c 100644 (file)
@@ -483,22 +483,7 @@ LIMIT {$offset}, {$rowCount}
   }
 
   public static function buildDedupeRules() {
-    $parent = CRM_Utils_Request::retrieve('parentId', 'Positive');
-
-    switch ($parent) {
-      case 1:
-        $contactType = 'Individual';
-        break;
-
-      case 2:
-        $contactType = 'Household';
-        break;
-
-      case 4:
-        $contactType = 'Organization';
-        break;
-    }
-
+    $contactType = CRM_Utils_Request::retrieve('parentId', 'Positive');
     $dedupeRules = CRM_Dedupe_BAO_DedupeRuleGroup::getByType($contactType);
 
     CRM_Utils_JSON::output($dedupeRules);