Skip to content

Commit

Permalink
Include tags when cloning a bug
Browse files Browse the repository at this point in the history
When cloning a bug, everything should be copied, including tags.

This commit prefills bug_report_page.php's Attach Tags input with the 
master issue's tags, allowing the user to decide which one(s) to keep.

Fixes: #26326
PR #1577
  • Loading branch information
KeyWeeUsr authored and dregad committed Nov 22, 2019
1 parent fc97585 commit 6fc90cf
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion bug_report_page.php
Expand Up @@ -605,7 +605,22 @@
<label for="attach_tag"><?php echo lang_get( 'tag_attach_long' ) ?></label>
</th>
<td>
<?php print_tag_input( '' ); ?>
<?php
if( $f_master_bug_id > 0 ) {
# pre-fill tag string when cloning from master bug
$t_tags = [];
foreach( tag_bug_get_attached( $f_master_bug_id ) as $t_tag ) {
array_push( $t_tags, $t_tag["name"] );
}
$t_tag_string = implode(
config_get( 'tag_separator' ), $t_tags
);
print_tag_input( 0, $t_tag_string );
} else {
# otherwise show just the default empty string
print_tag_input( '' );
}
?>
</td>
</tr>
<?php
Expand Down

0 comments on commit 6fc90cf

Please sign in to comment.