View Issue Details

IDProjectCategoryView StatusLast Update
0020082mantisbtcustom fieldspublic2015-12-06 02:45
Reportervboctor Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.3.0-beta.3 
Target Version1.3.0-rc.1Fixed in Version1.3.0-rc.1 
Summary0020082: Invalid query error when updating an issue
Description

In some cases a field would exist on the form but the value would evaluate to null. In such case, an invalid query is issue attempting to set the value of the custom field to null which is not allowed.

The fix would be to make sure that when we convert from value of the custom field to the database value we convert null to string. Before we used to skip these and hence didn't get the error, but that caused the issue with purging custom field values after setting them.

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'] ) ) {
            $t_value = call_user_func( $g_custom_field_type_definition[$p_type]['#function_value_to_database'], $p_value );
    }

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

}

Tagsmantishub

Activities

Related Changesets

MantisBT: master 99172361

2015-09-07 10:55

vboctor


Details Diff
Fix invalid query error when updating an issue

If a custom field is on the form but has value of null, it caused invalid query error.

Fixes 0020082
Affected Issues
0020082
mod - core/custom_field_api.php Diff File