Skip to content

Commit dea7e31

Browse files
committedMar 2, 2012
Add "New Issue" entry to history when copying bugs
When bug_copy() is called with p_copy_history=false, a 'NEW_BUG' history entry is added to ensure consistency of behavior with Clone button. Fixes #13816
1 parent cf5df42 commit dea7e31

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎core/bug_api.php

+5
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,8 @@ function bug_copy( $p_bug_id, $p_target_project_id = null, $p_copy_custom_fields
10371037
# COPY HISTORY
10381038
history_delete( $t_new_bug_id ); # should history only be deleted inside the if statement below?
10391039
if( $p_copy_history ) {
1040+
# @todo problem with this code: the generated history trail is incorrect because the note IDs are those of the original bug, not the copied ones
1041+
# @todo actually, does it even make sense to copy the history ?
10401042
$query = "SELECT *
10411043
FROM $t_mantis_bug_history_table
10421044
WHERE bug_id = " . db_param();
@@ -1056,6 +1058,9 @@ function bug_copy( $p_bug_id, $p_target_project_id = null, $p_copy_custom_fields
10561058
" . db_param() . " );";
10571059
db_query_bound( $query, Array( $t_bug_history['user_id'], $t_new_bug_id, $t_bug_history['date_modified'], $t_bug_history['field_name'], $t_bug_history['old_value'], $t_bug_history['new_value'], $t_bug_history['type'] ) );
10581060
}
1061+
} else {
1062+
# Create a "New Issue" history entry
1063+
history_log_event_special( $t_new_bug_id, NEW_BUG );
10591064
}
10601065

10611066
# Create history entries to reflect the copy operation

0 commit comments

Comments
 (0)
Please sign in to comment.