Skip to content

Commit

Permalink
Merge pull request #10591 from totten/master-casetype-flush
Browse files Browse the repository at this point in the history
CRM-20802 - CaseType - Flush any in-memory caches that might reference case-type
  • Loading branch information
colemanw authored Jul 1, 2017
2 parents 8ba7d4c + e492e27 commit 4c58a08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CRM/Case/BAO/CaseType.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ public static function add(&$params) {
}

$caseTypeDAO->copyValues($params);
return $caseTypeDAO->save();
$result = $caseTypeDAO->save();
CRM_Case_XMLRepository::singleton()->flush();
return $result;
}

/**
Expand Down
7 changes: 7 additions & 0 deletions CRM/Case/XMLRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ public static function singleton($fresh = FALSE) {
return self::$singleton;
}

public function flush() {
$this->xml = array();
$this->hookCache = NULL;
$this->allCaseTypes = NULL;
CRM_Core_DAO::$_dbColumnValueCache = array();
}

/**
* Class constructor.
*
Expand Down

0 comments on commit 4c58a08

Please sign in to comment.