summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Hook.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-08-20 05:12:21 +0200
committermkanat%bugzilla.org <>2008-08-20 05:12:21 +0200
commite9a2d105417e520a31dfc606d9c68e9dc7a9eab5 (patch)
tree3427a1f6e43492ce32727524bb10011a967ec513 /Bugzilla/Hook.pm
parentef1385c2174f17c63ca4b8eec861db76d7ef513d (diff)
downloadbugzilla-e9a2d105417e520a31dfc606d9c68e9dc7a9eab5.tar.gz
bugzilla-e9a2d105417e520a31dfc606d9c68e9dc7a9eab5.tar.xz
Bug 449306: Add a hook after a bug gets saved, and after flags get updated.
Patch By Jesse Clark <jjclark1982@gmail.com> r=mkanat, a=mkanat
Diffstat (limited to 'Bugzilla/Hook.pm')
-rw-r--r--Bugzilla/Hook.pm45
1 files changed, 45 insertions, 0 deletions
diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm
index b9b111963..b51f730bf 100644
--- a/Bugzilla/Hook.pm
+++ b/Bugzilla/Hook.pm
@@ -207,6 +207,25 @@ This works just like L</auth-login_methods> except it's for
login verification methods (See L<Bugzilla::Auth::Verify>.) It also
takes a C<modules> parameter, just like L</auth-login_methods>.
+=head2 bug-end_of_update
+
+This happens at the end of L<Bugzilla::Bug/update>, after all other changes are
+made to the database. This generally occurs inside a database transaction.
+
+Params:
+
+=over
+
+=item C<bug> - The changed bug object, with all fields set to their updated
+values.
+
+=item C<timestamp> - The timestamp used for all updates in this transaction.
+
+=item C<changes> - The hash of changed fields.
+C<$changes-E<gt>{field} = [old, new]>
+
+=back
+
=head2 buglist-columns
This happens in buglist.cgi after the standard columns have been defined and
@@ -308,6 +327,32 @@ Params:
=back
+=head2 flag-end_of_update
+
+This happens at the end of L<Bugzilla::Flag/process>, after all other changes
+are made to the database and after emails are sent. It gives you a before/after
+snapshot of flags so you can react to specific flag changes.
+This generally occurs inside a database transaction.
+
+Note that the interface to this hook is B<UNSTABLE> and it may change in the
+future.
+
+Params:
+
+=over
+
+=item C<bug> - The changed bug object.
+
+=item C<timestamp> - The timestamp used for all updates in this transaction.
+
+=item C<old_flags> - The snapshot of flag summaries from before the change.
+
+=item C<new_flags> - The snapshot of flag summaries after the change. Call
+C<my ($removed, $added) = diff_arrays(old_flags, new_flags)> to get the list of
+changed flags, and search for a specific condition like C<added eq 'review-'>.
+
+=back
+
=head2 install-requirements
Because of the way Bugzilla installation works, there can't be a normal