diff options
-rw-r--r-- | extensions/Mageia/Extension.pm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/extensions/Mageia/Extension.pm b/extensions/Mageia/Extension.pm index 819838b95..60ca57f00 100644 --- a/extensions/Mageia/Extension.pm +++ b/extensions/Mageia/Extension.pm @@ -49,10 +49,15 @@ sub bug_end_of_update { my $dbh = Bugzilla->dbh; my $user = Bugzilla->user; - # If a user enters 'validated_update' as keyword, - # automatically CC sysadmin-bugs@ml.mageia.org. - my $new_keywords_str = $args->{changes}->{keywords}->[1]; + my $new_keywords_str; + # Call exists to avoid autovivification of $args->{changes} if it does not exist. + # Else $bug->update() always sees the bug as being edited. + if (exists $args->{changes} && exists $args->{changes}->{keywords}) { + $new_keywords_str = $args->{changes}->{keywords}->[1]; + } + # If a user enters 'validated_update' as keyword, automatically + # CC sysadmin-bugs@ml.mageia.org. if ($new_keywords_str) { my @new_keywords = split(/[,\s]+/, $new_keywords_str); if (grep { $_ eq 'validated_update' } @new_keywords |