From c2fef4494755f341a1d17fc61f208b3cb650da1d Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 17 Jun 2014 19:36:07 +0000 Subject: Bug 1026415 - Some empty fields are present as "" rather than being absent --- extensions/BzAPI/lib/Util.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'extensions/BzAPI/lib') diff --git a/extensions/BzAPI/lib/Util.pm b/extensions/BzAPI/lib/Util.pm index 9858c17a1..e25e75b55 100644 --- a/extensions/BzAPI/lib/Util.pm +++ b/extensions/BzAPI/lib/Util.pm @@ -190,6 +190,7 @@ sub fix_bug { next; } + next if $method eq 'Bug.search' && $key eq 'url'; # Return url even if empty next if $method eq 'Bug.search' && $key eq 'keywords'; # Return keywords even if empty next if $method eq 'Bug.get' && grep($_ eq $key, TIMETRACKING_FIELDS); @@ -232,7 +233,7 @@ sub fix_user { $data = { name => filter_email($object->login) }; - if ($user->id) { + if ($user->id && $object->name) { $data->{real_name} = $rpc->type('string', $object->name); } } @@ -244,6 +245,8 @@ sub fix_user { $data->{ref} = $rpc->type('string', ref_urlbase . "/user/" . $object->login); } + delete $data->{real_name} if !$data->{real_name}; + return $data; } -- cgit v1.2.3-24-g4f1b