From 292fbfa3300ca50dc4cbb266dd99d213b887f8fd Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 17 Jan 2020 23:44:18 -0800 Subject: [PATCH] CRM_Core_Menu - Fix warnings during local test run (dev/core#742) Before ------ In certain local OSX+D8 test environments, when running the full suite, I got a large number of warnings like this: ``` Warning: simplexml_load_file(): I/O warning : failed to load external entity "/Users/totten/bknix/build/drupal8-clean/web/vendor/civicrm/civicrm-core//CRM/Campaign/xml/Menu/Campaign.xml" in /Users/totten/bknix/build/drupal8-clean/web/vendor/civicrm/civicrm-core/CRM/Core/Menu.php on line 99 ``` After ----- Those warnings seem to have gone away. The menu still seems to populate correctly. Comments -------- This smells a lot like dev/core#742 -- e.g. it's the same warning and (after adjusting for changes in line-numbering over the months) same line of code. --- CRM/Core/Menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/Menu.php b/CRM/Core/Menu.php index ceb7e2a98c..f370b8cacb 100644 --- a/CRM/Core/Menu.php +++ b/CRM/Core/Menu.php @@ -96,7 +96,7 @@ class CRM_Core_Menu { * @throws Exception */ public static function read($name, &$menu) { - $xml = simplexml_load_file($name); + $xml = simplexml_load_string(file_get_contents($name)); self::readXML($xml, $menu); } -- 2.25.1