Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 38e23e3

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 dd634e7 commit 38e23e3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎core/bug_api.php

+6
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,8 @@ function bug_copy( $p_bug_id, $p_target_project_id = null, $p_copy_custom_fields
10221022
# COPY HISTORY
10231023
history_delete( $t_new_bug_id ); # should history only be deleted inside the if statement below?
10241024
if( $p_copy_history ) {
1025+
# @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
1026+
# @todo actually, does it even make sense to copy the history ?
10251027
$query = "SELECT *
10261028
FROM $t_mantis_bug_history_table
10271029
WHERE bug_id = " . db_param();
@@ -1041,8 +1043,12 @@ function bug_copy( $p_bug_id, $p_target_project_id = null, $p_copy_custom_fields
10411043
" . db_param() . " );";
10421044
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'] ) );
10431045
}
1046+
} else {
1047+
# Create a "New Issue" history entry
1048+
history_log_event_special( $t_new_bug_id, NEW_BUG );
10441049
}
10451050

1051+
10461052
# Create history entries to reflect the copy operation
10471053
history_log_event_special( $t_new_bug_id, BUG_CREATED_FROM, '', $t_bug_id );
10481054
history_log_event_special( $t_bug_id, BUG_CLONED_TO, '', $t_new_bug_id );

0 commit comments

Comments
 (0)
Please sign in to comment.