summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-01-22 06:00:21 +0100
committerByron Jones <glob@mozilla.com>2015-01-22 06:00:21 +0100
commit81b2c31a192082fd09787f8cf08ba5ef2236abfb (patch)
tree24128aa2aabf8e115ea84e8d6dccabff16b84daf
parent0ded1f3de892d2cd536d469279744a1aeef45bc5 (diff)
downloadbugzilla-81b2c31a192082fd09787f8cf08ba5ef2236abfb.tar.gz
bugzilla-81b2c31a192082fd09787f8cf08ba5ef2236abfb.tar.xz
Bug 1119988: form.dev-engagement-event: disabled accounts causes invalid/incomplete bugs to be created
-rw-r--r--extensions/BMO/Extension.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm
index 604de68cb..458be737f 100644
--- a/extensions/BMO/Extension.pm
+++ b/extensions/BMO/Extension.pm
@@ -1390,6 +1390,7 @@ sub _post_dev_engagement {
Bugzilla->error_mode(ERROR_MODE_DIE);
my $discussion_bug;
+ my @warnings;
eval {
# Add attachment containing tab delimited field values for
# spreadsheet import.
@@ -1485,6 +1486,12 @@ EOF
foreach my $type (@{ $discussion_bug->flag_types }) {
next if $type->name ne 'needinfo';
foreach my $requestee (DEV_ENGAGE_DISCUSS_NEEDINFO()) {
+ # needinfo'ing a disable account throws an error - warn instead
+ my $requestee_object = Bugzilla::User->new({ name => $requestee, cache => 1 });
+ if (!$requestee_object || !$requestee_object->is_enabled) {
+ push @warnings, "Failed to needinfo $requestee on dev-engagement bug (does not exist or disabled)";
+ next;
+ }
my $needinfo_flag = {
type_id => $type->id,
status => '?',
@@ -1508,6 +1515,10 @@ EOF
Bugzilla->set_user($old_user);
Bugzilla->error_mode($error_mode_cache);
+ foreach my $warning (@warnings) {
+ warn $warning . "\n";
+ }
+
# No matter what happened, ensure the parent bug gets marked as updated
# There's no need to send mail for parent bug
$parent_bug->update($parent_bug->creation_ts);