summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-08-05 14:35:50 +0200
committerlpsolit%gmail.com <>2009-08-05 14:35:50 +0200
commitd0002e9626b97df6fad2c597b89c8ec31f7c308a (patch)
treeb14fd7ecb63ad9931b5c72e9c666ef499f0daa1d /extensions
parent8b2db148f30d74283d3a80ebd77691c94a1ca4a7 (diff)
downloadbugzilla-d0002e9626b97df6fad2c597b89c8ec31f7c308a.tar.gz
bugzilla-d0002e9626b97df6fad2c597b89c8ec31f7c308a.tar.xz
Bug 415541: Implement $bug->set_flags() and $attachment->set_flags() - Patch by Frédéric Buclin <LpSolit@gmail.com> a=LpSolit
Diffstat (limited to 'extensions')
-rw-r--r--extensions/example/code/flag-end_of_update.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/extensions/example/code/flag-end_of_update.pl b/extensions/example/code/flag-end_of_update.pl
index 6371bd154..e1705cc57 100644
--- a/extensions/example/code/flag-end_of_update.pl
+++ b/extensions/example/code/flag-end_of_update.pl
@@ -26,15 +26,15 @@ use Bugzilla::Util qw(diff_arrays);
# This code doesn't actually *do* anything, it's just here to show you
# how to use this hook.
my $args = Bugzilla->hook_args;
-my ($bug, $timestamp, $old_flags, $new_flags) =
- @$args{qw(bug timestamp old_flags new_flags)};
+my ($object, $timestamp, $old_flags, $new_flags) =
+ @$args{qw(object timestamp old_flags new_flags)};
my ($removed, $added) = diff_arrays($old_flags, $new_flags);
my ($granted, $denied) = (0, 0);
foreach my $new_flag (@$added) {
$granted++ if $new_flag =~ /\+$/;
$denied++ if $new_flag =~ /-$/;
}
-my $bug_id = $bug->id;
+my $bug_id = (ref $object eq 'Bugzilla::Bug') ? $object->id : $object->bug_id;
my $result = "$granted flags were granted and $denied flags were denied"
. " on bug $bug_id at $timestamp.";
# Uncomment this line to see $result in your webserver's error log whenever