Merge in 5.27
[civicrm-core.git] / CRM / Extension / Manager / Search.php
index d79e2472ae5ff98c8710f4efe6a650ace7cb93df..d498711f528b4c6d0da5c02e861b6be2a7de52d1 100644 (file)
@@ -69,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;
   }