Merge pull request #10933 from civicrm/4.7.24-rc
[civicrm-core.git] / CRM / Case / XMLRepository.php
index 89dcce5ce4af0b65e4f1b22b674b81aee38a8a91..a86e440160773feb5ed4e907e8c38159bf2abafb 100644 (file)
@@ -63,6 +63,13 @@ class CRM_Case_XMLRepository {
     return self::$singleton;
   }
 
+  public function flush() {
+    $this->xml = array();
+    $this->hookCache = NULL;
+    $this->allCaseTypes = NULL;
+    CRM_Core_DAO::$_dbColumnValueCache = array();
+  }
+
   /**
    * Class constructor.
    *
@@ -136,7 +143,9 @@ class CRM_Case_XMLRepository {
     if ($fileName && file_exists($fileName)) {
       // read xml file
       $dom = new DomDocument();
-      $dom->load($fileName);
+      $xmlString = file_get_contents($fileName);
+      $dom->loadXML($xmlString);
+      $dom->documentURI = $fileName;
       $dom->xinclude();
       $fileXml = simplexml_import_dom($dom);
     }