Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
07f947c9
Commit
07f947c9
authored
Apr 02, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 556736: Make the bug_end_of_update hook also send $old_bug to the hook
r=mkanat, a=mkanat (module owner)
parent
2a444f9d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
Bug.pm
Bugzilla/Bug.pm
+3
-4
Hook.pm
Bugzilla/Hook.pm
+14
-5
Extension.pm
extensions/Example/Extension.pm
+5
-2
No files found.
Bugzilla/Bug.pm
View file @
07f947c9
...
@@ -865,10 +865,9 @@ sub update {
...
@@ -865,10 +865,9 @@ sub update {
$changes
->
{
'dup_id'
}
=
[
$old_dup
||
undef
,
$cur_dup
||
undef
];
$changes
->
{
'dup_id'
}
=
[
$old_dup
||
undef
,
$cur_dup
||
undef
];
}
}
Bugzilla::Hook::
process
(
'bug_end_of_update'
,
{
bug
=>
$self
,
Bugzilla::Hook::
process
(
'bug_end_of_update'
,
timestamp
=>
$delta_ts
,
{
bug
=>
$self
,
timestamp
=>
$delta_ts
,
changes
=>
$changes
,
changes
=>
$changes
,
old_bug
=>
$old_bug
});
});
# If any change occurred, refresh the timestamp of the bug.
# If any change occurred, refresh the timestamp of the bug.
if
(
scalar
(
keys
%
$changes
)
||
$self
->
{
added_comments
})
{
if
(
scalar
(
keys
%
$changes
)
||
$self
->
{
added_comments
})
{
...
...
Bugzilla/Hook.pm
View file @
07f947c9
...
@@ -239,13 +239,22 @@ Params:
...
@@ -239,13 +239,22 @@ Params:
=over
=over
=item C<bug> - The changed bug object, with all fields set to their updated
=item C<bug>
values.
=item C<timestamp> - The timestamp used for all updates in this transaction
.
The changed bug object, with all fields set to their updated values
.
=item C<changes> - The hash of changed fields.
=item C<old_bug>
C<$changes-E<gt>{field} = [old, new]>
A bug object pulled from the database before the fields were set to
their updated values (so it has the old values available for each field).
=item C<timestamp>
The timestamp used for all updates in this transaction.
=item C<changes>
The hash of changed fields. C<< $changes->{field} = [old, new] >>
=back
=back
...
...
extensions/Example/Extension.pm
View file @
07f947c9
...
@@ -119,13 +119,16 @@ sub bug_end_of_update {
...
@@ -119,13 +119,16 @@ sub bug_end_of_update {
# This code doesn't actually *do* anything, it's just here to show you
# This code doesn't actually *do* anything, it's just here to show you
# how to use this hook.
# how to use this hook.
my
(
$bug
,
$timestamp
,
$changes
)
=
@$args
{
qw(bug timestamp changes)
};
my
(
$bug
,
$old_bug
,
$timestamp
,
$changes
)
=
@$args
{
qw(bug old_bug timestamp changes)
};
foreach
my
$field
(
keys
%
$changes
)
{
foreach
my
$field
(
keys
%
$changes
)
{
my
$used_to_be
=
$changes
->
{
$field
}
->
[
0
];
my
$used_to_be
=
$changes
->
{
$field
}
->
[
0
];
my
$now_it_is
=
$changes
->
{
$field
}
->
[
1
];
my
$now_it_is
=
$changes
->
{
$field
}
->
[
1
];
}
}
my
$old_summary
=
$old_bug
->
short_desc
;
my
$status_message
;
my
$status_message
;
if
(
my
$status_change
=
$changes
->
{
'bug_status'
})
{
if
(
my
$status_change
=
$changes
->
{
'bug_status'
})
{
my
$old_status
=
new
Bugzilla::
Status
({
name
=>
$status_change
->
[
0
]
});
my
$old_status
=
new
Bugzilla::
Status
({
name
=>
$status_change
->
[
0
]
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment