Merge in 5.27
[civicrm-core.git] / CRM / Extension / Manager / Search.php
index a5da9e47c2ab5df3d46be0c9ab5a9b46753d6fa4..d498711f528b4c6d0da5c02e861b6be2a7de52d1 100644 (file)
@@ -55,8 +55,7 @@ class CRM_Extension_Manager_Search extends CRM_Extension_Manager_Base {
       'is_active' => 1,
     ];
 
-    $ids = [];
-    $optionValue = CRM_Core_BAO_OptionValue::add($params, $ids);
+    $optionValue = CRM_Core_BAO_OptionValue::add($params);
 
     return $optionValue ? TRUE : FALSE;
   }
@@ -70,12 +69,12 @@ class CRM_Extension_Manager_Search extends CRM_Extension_Manager_Base {
   public function onPreUninstall(CRM_Extension_Info $info) {
     $customSearchesByName = $this->getCustomSearchesByName();
     if (!array_key_exists($info->key, $customSearchesByName)) {
-      CRM_Core_Error::fatal('This custom search is not registered.');
+      throw new CRM_Core_Exception('This custom search is not registered.');
     }
 
     $cs = $this->getCustomSearchesById();
     $id = $cs[$customSearchesByName[$info->key]];
-    $optionValue = CRM_Core_BAO_OptionValue::del($id);
+    CRM_Core_BAO_OptionValue::del($id);
 
     return TRUE;
   }