Merge pull request #10700 from alifrumin/participantnote
[civicrm-core.git] / CRM / Case / XMLRepository.php
index 34fc42da55dbfbff823c43ed5e018fac3e42b028..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,9 +143,9 @@ class CRM_Case_XMLRepository {
     if ($fileName && file_exists($fileName)) {
       // read xml file
       $dom = new DomDocument();
-      $oldValue = libxml_disable_entity_loader(FALSE);
-      $dom->load($fileName);
-      libxml_disable_entity_loader($oldValue);
+      $xmlString = file_get_contents($fileName);
+      $dom->loadXML($xmlString);
+      $dom->documentURI = $fileName;
       $dom->xinclude();
       $fileXml = simplexml_import_dom($dom);
     }