i am testing the datepicker -> https://github.com/mantisbt/mantisbt/pull/65/files, i also added the code from here: http://www.mantisbt.org/bugs/view.php?id=8957
to have no default value.
I need some clarification, i have some customfields which are not shown on ticket creation, ~ devs should fill it out later.
But after ticket creation they are set to 1970/01/01, is this normal behaivour, or did i mess something up in the code?
If i disable the datepicker everything works fine. Someone is running a working datepicker under 1.2.19?
Update: Seems like the missing fields got a 0 at creation which would be displayed as the default date.
Following Change solves it: add the 4 commented lines in custom_field_api.php(type = 8 should always be the type for date field i guess) :
Code: Select all
function string_custom_field_value( $p_def, $p_field_id, $p_bug_id ) {
$t_custom_field_value = custom_field_get_value( $p_field_id, $p_bug_id );
if( $t_custom_field_value === null ) {
return '';
}
#only the following 4 lines are new:
if ( $t_custom_field_value == '0' && $p_def['type'] == '8')
{
return '';
}
global $g_custom_field_type_definition;
if( isset( $g_custom_field_type_definition[$p_def['type']]['#function_string_value'] ) ) {
return call_user_func( $g_custom_field_type_definition[$p_def['type']]['#function_string_value'], $t_custom_field_value );
}
return string_display_links( $t_custom_field_value );
}
Joey