Merge pull request #17253 from mattwire/utf8convertblocksize
[civicrm-core.git] / CRM / Core / BAO / WordReplacement.php
index e5e215a46c95f20ce94b53ae0e1f06b68f5cdcc5..ba4f09d7fa43d4d8dc3a3807728a8305eb4fb87d 100644 (file)
@@ -51,6 +51,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement {
    * @param null $reset
    *
    * @return null|CRM_Core_BAO_WordReplacement
+   * @throws CRM_Core_Exception
    */
   public static function getWordReplacement($reset = NULL) {
     static $wordReplacement = NULL;
@@ -58,7 +59,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement {
       $wordReplacement = new CRM_Core_BAO_WordReplacement();
       $wordReplacement->id = CRM_Core_Config::wordReplacementID();
       if (!$wordReplacement->find(TRUE)) {
-        CRM_Core_Error::fatal();
+        throw new CRM_Core_Exception('Unable to find word replacement');
       }
     }
     return $wordReplacement;
@@ -232,7 +233,7 @@ WHERE  domain_id = %1
           $localCustomData = $localeCustomArray[$lang];
           // Traverse status array "enabled" "disabled"
           foreach ($localCustomData as $status => $matchTypes) {
-            $params["is_active"] = ($status == "enabled") ? TRUE : FALSE;
+            $params["is_active"] = $status == "enabled";
             // Traverse Match Type array "wildcardMatch" "exactMatch"
             foreach ($matchTypes as $matchType => $words) {
               $params["match_type"] = $matchType;