Skip to content

Commit

Permalink
Fix invalid query error when updating an issue
Browse files Browse the repository at this point in the history
If a custom field is on the form but has value of null, it caused invalid query error.

Fixes #20082
  • Loading branch information
vboctor committed Sep 11, 2015
1 parent c3f52b7 commit 9917236
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/custom_field_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1114,10 +1114,14 @@ function custom_field_distinct_values( array $p_field_def, $p_project_id = ALL_P
*/
function custom_field_value_to_database( $p_value, $p_type ) {
global $g_custom_field_type_definition;

$t_value = $p_value;

if( isset( $g_custom_field_type_definition[$p_type]['#function_value_to_database'] ) ) {
return call_user_func( $g_custom_field_type_definition[$p_type]['#function_value_to_database'], $p_value );
$t_value = call_user_func( $g_custom_field_type_definition[$p_type]['#function_value_to_database'], $p_value );
}
return $p_value;

return $t_value === null ? '' : $t_value;
}

/**
Expand Down

0 comments on commit 9917236

Please sign in to comment.