From c3b278f6ffcd4d1591bb9e4ebb2feeaea56a46c8 Mon Sep 17 00:00:00 2001 From: DemeritCowboy Date: Mon, 2 Sep 2019 10:51:01 -0400 Subject: [PATCH] simplify logic --- CRM/Case/XMLProcessor/Process.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CRM/Case/XMLProcessor/Process.php b/CRM/Case/XMLProcessor/Process.php index d2c2cfbe2e..1b96b2e152 100644 --- a/CRM/Case/XMLProcessor/Process.php +++ b/CRM/Case/XMLProcessor/Process.php @@ -867,12 +867,13 @@ AND a.is_deleted = 0 * the number 0 - use machineName (but can't really have number 0 in simplexml unless cast to number) * the word 'null' - use machineName and best not to think about it */ - if (empty($xml->machineName)) { - if (!isset($xml->machineName) || ((string) $xml->machineName) !== '0') { - return (string) $xml->name; + if (isset($xml->machineName)) { + $machineName = (string) $xml->machineName; + if ($machineName !== '') { + return $machineName; } } - return (string) $xml->machineName; + return (string) $xml->name; } } -- 2.25.1