summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Object.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-11 02:39:05 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-11 02:39:05 +0100
commit6b4e9edae6b5accf757097a5e7af97c2fba8f0ff (patch)
tree60f2102816a06d0cb6043c38ff63abd55b1990be /Bugzilla/Object.pm
parentaca53c540c69496390b172a55a46b817d2828d0f (diff)
downloadbugzilla-6b4e9edae6b5accf757097a5e7af97c2fba8f0ff.tar.gz
bugzilla-6b4e9edae6b5accf757097a5e7af97c2fba8f0ff.tar.xz
Bug 545551: Hook: object_update_columns
r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'Bugzilla/Object.pm')
-rw-r--r--Bugzilla/Object.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm
index e7763157a..dac8962ff 100644
--- a/Bugzilla/Object.pm
+++ b/Bugzilla/Object.pm
@@ -322,11 +322,17 @@ sub update {
$dbh->bz_start_transaction();
my $old_self = $self->new($self->id);
-
+
+ my @all_columns = $self->UPDATE_COLUMNS;
+ my @hook_columns;
+ Bugzilla::Hook::process('object_update_columns',
+ { object => $self, columns => \@hook_columns });
+ push(@all_columns, @hook_columns);
+
my %numeric = map { $_ => 1 } $self->NUMERIC_COLUMNS;
my %date = map { $_ => 1 } $self->DATE_COLUMNS;
my (@update_columns, @values, %changes);
- foreach my $column ($self->UPDATE_COLUMNS) {
+ foreach my $column (@all_columns) {
my ($old, $new) = ($old_self->{$column}, $self->{$column});
# This has to be written this way in order to allow us to set a field
# from undef or to undef, and avoid warnings about comparing an undef