Skip to content

Commit 25f2af8

Browse files
committedOct 20, 2011
Init custom fields default value when reporting bug
Fix for #13406, written by labattsguy. Prior to this, default values for custom fields were not written to the database at all. Partially reverts commit bbe690f
1 parent 46960e0 commit 25f2af8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎bug_report.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
}
213213

214214
$t_def = custom_field_get_definition( $t_id );
215-
if( !custom_field_set_value( $t_id, $t_bug_id, gpc_get_custom_field( "custom_field_$t_id", $t_def['type'], '' ), false ) ) {
215+
if( !custom_field_set_value( $t_id, $t_bug_id, gpc_get_custom_field( "custom_field_$t_id", $t_def['type'], $t_def['default_value'] ), false ) ) {
216216
error_parameters( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ) );
217217
trigger_error( ERROR_CUSTOM_FIELD_INVALID_VALUE, ERROR );
218218
}
@@ -241,27 +241,27 @@
241241

242242
# Send the email notification
243243
email_relationship_added( $f_master_bug_id, $t_bug_id, relationship_get_complementary_type( $f_rel_type ) );
244-
244+
245245
# update relationship target bug last updated
246246
bug_update_date( $t_bug_id );
247247
}
248248

249249
# copy notes from parent
250250
if ( $f_copy_notes_from_parent ) {
251-
251+
252252
$t_parent_bugnotes = bugnote_get_all_bugnotes( $f_master_bug_id );
253-
253+
254254
foreach ( $t_parent_bugnotes as $t_parent_bugnote ) {
255-
255+
256256
$t_private = $t_parent_bugnote->view_state == VS_PRIVATE;
257257

258-
bugnote_add( $t_bug_id, $t_parent_bugnote->note, $t_parent_bugnote->time_tracking,
258+
bugnote_add( $t_bug_id, $t_parent_bugnote->note, $t_parent_bugnote->time_tracking,
259259
$t_private, $t_parent_bugnote->note_type, $t_parent_bugnote->note_attr,
260260
$t_parent_bugnote->reporter_id, /* send_email */ FALSE , /* date submitted */ 0,
261261
/* date modified */ 0, /* log history */ FALSE);
262262
}
263263
}
264-
264+
265265
# copy attachments from parent
266266
if ( $f_copy_attachments_from_parent ) {
267267
file_copy_attachments( $f_master_bug_id, $t_bug_id );

0 commit comments

Comments
 (0)
Please sign in to comment.