Index: branches/5.1.x/core/units/admin/admin_events_handler.php =================================================================== diff -u -N -r13664 -r13935 --- branches/5.1.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 13664) +++ branches/5.1.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 13935) @@ -1,6 +1,6 @@ add formatter $field_options['formatter'] = 'kFormatter'; $field_options['format'] = '%01.'.$regs[1].'f'; - if ($field_info['Null'] != 'YES') { + + if ($not_null) { // null fields, will most likely have NULL as default value $default_value = 0; } } - else { + elseif ($not_null) { // no size information, just convert to float - if ($field_info['Null'] != 'YES') { - // null fields, will most likely have NULL as default value - $default_value = (float)$default_value; - } + // null fields, will most likely have NULL as default value + $default_value = (float)$default_value; + } } @@ -302,7 +313,7 @@ $grid_col_options['filter_block'] = 'grid_options_filter'; } - if ($field_info['Null'] != 'YES') { + if ($not_null) { $field_options['not_null'] = 1; } @@ -311,15 +322,15 @@ $id_field = $field_info['Field']; } - if ($php_type == 'int' && !array_key_exists('not_null', $field_options)) { + if ($php_type == 'int' && !$not_null) { // numeric null field if (preg_match('/(On|Date)$/', $field_info['Field']) || $field_info['Field'] == 'Modified') { $field_options['formatter'] = 'kDateFormatter'; $grid_col_options['filter_block'] = 'grid_date_rage_filter'; } } - if ($php_type == 'int' && ($field_info['Null'] != 'YES' || is_numeric($default_value))) { + if ($php_type == 'int' && ($not_null || is_numeric($default_value))) { // is integer field AND not null $field_options['default'] = (int)$default_value; }