Merge pull request #15144 from JKingsnorth/copying-events-contribution-pages
[civicrm-core.git] / CRM / Case / XMLProcessor / Process.php
index d2c2cfbe2eee1c05bd6f5dfb13c58ca84bfae537..1b96b2e152485abeec18c83236471e043dea6240 100644 (file)
@@ -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;
   }
 
 }