From 6ef766edf0789623e87d01c8df1e1d2a53eaafa0 Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 10 Jun 2021 11:00:09 -0600 Subject: [PATCH] Etemplate: Better error message for parse errors in xml strings (not files) This happens in things like Transformer, where we generate some XML for parsing (cherry picked from commit 7cf7c5a6389452f96528f59ebe59349718545d77) --- api/src/Etemplate/Widget.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/src/Etemplate/Widget.php b/api/src/Etemplate/Widget.php index 6c27a3ec19..48cc30bf7d 100644 --- a/api/src/Etemplate/Widget.php +++ b/api/src/Etemplate/Widget.php @@ -139,6 +139,10 @@ class Widget if (!$ok && ($error = libxml_get_last_error())) { $file = str_replace([EGW_SERVER_ROOT.'/', '//default/etemplates/'], '', $error->file); + if(!$file && is_string($xml)) + { + $file = $xml; + } throw new \Exception("Error passing XML file '$file' line $error->line: $error->message"); }