Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#1046 - simplify logic #15192

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
simplify logic
demeritcowboy committed Sep 2, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit c3b278f6ffcd4d1591bb9e4ebb2feeaea56a46c8
9 changes: 5 additions & 4 deletions CRM/Case/XMLProcessor/Process.php
Original file line number Diff line number Diff line change
@@ -867,12 +867,13 @@ public function locateNameOrLabel($xml) {
* 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;
}

}