X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FWordReplacement.php;h=1d933ec2eb4c6d5ad79cf344274d596f5734e371;hb=db551313046d894dd1e7669f664ca7caac35f6fe;hp=d5ae5a44b05b542275a387ba86f687a78c1ae929;hpb=4c95b949e863281d990ffa2a3104415079e6352d;p=civicrm-core.git diff --git a/CRM/Core/BAO/WordReplacement.php b/CRM/Core/BAO/WordReplacement.php index d5ae5a44b0..1d933ec2eb 100644 --- a/CRM/Core/BAO/WordReplacement.php +++ b/CRM/Core/BAO/WordReplacement.php @@ -38,6 +38,15 @@ */ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { + /** + * Class constructor + * + * @access public + * @return \CRM_Core_DAO_WordReplacement + */ + /** + * + */ function __construct() { parent::__construct(); } @@ -48,7 +57,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { * @param array $params (reference ) an assoc array of name/value pairs * @param array $defaults (reference ) an assoc array to hold the flattened values * - * @return object CRM_Core_DAO_WordRepalcement object + * @return CRM_Core_DAO_WordRepalcement object * @access public * @static */ @@ -60,6 +69,8 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { /** * Get the domain BAO * + * @param null $reset + * * @return null|object CRM_Core_BAO_WordRepalcement * @access public * @static @@ -80,6 +91,9 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { /** * Save the values of a WordReplacement * + * @param array $params + * @param int $id + * * @return WordReplacement array * @access public */ @@ -97,6 +111,8 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { /** * Create a new WordReplacement * + * @param array $params + * * @return WordReplacement array * @access public */ @@ -179,7 +195,7 @@ WHERE domain_id = %1 /** * Rebuild */ - static function rebuild() { + static function rebuild($clearCaches = TRUE) { $id = CRM_Core_Config::domainID(); $stringOverride = self::getAllAsConfigArray($id); $params = array('locale_custom_strings' => serialize($stringOverride)); @@ -187,10 +203,13 @@ WHERE domain_id = %1 if ($wordReplacementSettings) { CRM_Core_Config::singleton()->localeCustomStrings = $stringOverride; - // Reset navigation - CRM_Core_BAO_Navigation::resetNavigation(); - // Clear js string cache - CRM_Core_Resources::singleton()->flushStrings(); + // Partially mitigate the inefficiency introduced in CRM-13187 by doing this conditionally + if ($clearCaches) { + // Reset navigation + CRM_Core_BAO_Navigation::resetNavigation(); + // Clear js localization + CRM_Core_Resources::singleton()->flushStrings()->resetCacheCode(); + } return TRUE; }