From d5c1d67198505cc72845d512628852ace9ce799e Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 26 Aug 2014 12:51:09 +0800 Subject: Bug 1051655: mentor field updated/reset when a bug is updated as a result of a change on a different bug (eg. see also, duplicate) --- Bugzilla/Bug.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index e8f0fd44a..3310afe3d 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -684,8 +684,13 @@ sub create { my ($class, $params) = @_; my $dbh = Bugzilla->dbh; - # BMO - allow parameter alteration before creation - Bugzilla::Hook::process('bug_before_create', { params => $params }); + # BMO - allow parameter alteration before creation. also add support for + # fields which are not bug columns (eg bug_mentors). extensions should move + # fields from $params to $stash, then use the bug_end_of_create hook to + # update the database + my $stash = {}; + Bugzilla::Hook::process('bug_before_create', { params => $params, + stash => $stash }); $dbh->bz_start_transaction(); @@ -803,8 +808,10 @@ sub create { # but sometimes it's blank. Bugzilla::Comment->insert_create_data($creation_comment); + # BMO - add the stash param from bug_start_of_create Bugzilla::Hook::process('bug_end_of_create', { bug => $bug, timestamp => $timestamp, + stash => $stash, }); $dbh->bz_commit_transaction(); -- cgit v1.2.3-24-g4f1b