summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2018-01-09 18:23:18 +0100
committerGitHub <noreply@github.com>2018-01-09 18:23:18 +0100
commit039975deef0fae8e9d64db7b237e262e4f095eff (patch)
tree1e819f6f9bf5268854fe1872cc9378d7f6674ea5 /extensions
parent4497374cd98398d349164a4e1bb3292187cec53a (diff)
downloadbugzilla-039975deef0fae8e9d64db7b237e262e4f095eff.tar.gz
bugzilla-039975deef0fae8e9d64db7b237e262e4f095eff.tar.xz
Bug 1429110: Update Revision.pm type checking to treat bug id as a simple string
Diffstat (limited to 'extensions')
-rw-r--r--extensions/PhabBugz/lib/Revision.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/extensions/PhabBugz/lib/Revision.pm b/extensions/PhabBugz/lib/Revision.pm
index e229043e2..59312b39d 100644
--- a/extensions/PhabBugz/lib/Revision.pm
+++ b/extensions/PhabBugz/lib/Revision.pm
@@ -22,12 +22,6 @@ use Bugzilla::Extension::PhabBugz::Util qw(
use Types::Standard -all;
use Type::Utils;
-my $EmptyStr = declare "EmptyStr",
- as Str,
- where { length($_) == 0 },
- inline_as { $_[0]->parent->inline_check($_) . " && length($_) == 0" },
- message { "String is not empty" };
-
my $SearchResult = Dict[
id => Int,
type => Str,
@@ -42,7 +36,7 @@ my $SearchResult = Dict[
repositoryPHID => Maybe[Str],
status => HashRef,
summary => Str,
- "bugzilla.bug-id" => Int | $EmptyStr,
+ "bugzilla.bug-id" => Str
],
attachments => Dict[
reviewers => Dict[
@@ -97,6 +91,10 @@ sub _load {
$result = $result->{result}->{data}->[0];
}
+ # Some values in Phabricator for bug ids may have been saved
+ # white whitespace so we remove any here just in case.
+ $result->{fields}->{'bugzilla.bug-id'} = trim($result->{fields}->{'bugzilla.bug-id'});
+
return $result;
}