View Issue Details

IDProjectCategoryView StatusLast Update
0016954mantisbtcustom fieldspublic2019-09-26 16:41
Reporterbadfiles Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
Product Version1.2.17 
Summary0016954: Date type custom field with a default value set might result in application error on a new bug adding
Description

The issue is conditional

Steps To Reproduce

Set a default value to a date type custom filed.
Make it shown on a new bug adding.
Do not require it.
Try adding a new bug blanking the date.

You will get the bug added with an empty field (just as desired) and the application error shown.
If you had not set a default value, an empty date field would not cause an error.

TagsNo tags attached.

Relationships

duplicate of 0016952 new When reporting issue receive error on custom field, but issue is still created 
related to 0017354 closedcproensa Non-required custom fields with a minimum length fail to validate 

Activities

badfiles

badfiles

2014-02-11 15:03

reporter   ~0039376

seems like it's a dupe of 0016952

badfiles

badfiles

2014-02-15 07:29

reporter   ~0039411

This is how I've overridden the problem with an empty date field, but the problem is more complex – an error in a custom field does not prevent new bug to be inserted into the database.
Also a reporter is suggested to go back and fix the issue, and if one does so, an identical bug will be added.

https://github.com/badfiles/mantisbt/commit/4bbe25949154849b065f4e94565a2d3c7eb31c7d

ftaysse

ftaysse

2014-07-24 12:45

reporter   ~0040969

Last edited: 2014-07-24 12:47

Related to 0017354
Custom fields that are not required are still validated (twice)

In file bug_report.php:
Line 165: if( !custom_field_set_value( $t_id, $t_bug_id, gpc_get_custom_field( "customfield$t_id", $t_def['type'], $t_def['default_value'] ), false ) ) {
Modified: if( !custom_field_set_value( $t_id, $t_bug_id, gpc_get_custom_field( "customfield$t_id", $t_def['type'], $t_def['default_value'] ), false ) && ( $t_def['require_report'] ) ) {

dregad

dregad

2019-09-17 08:15

developer   ~0062849

Closing as duplicate of 0016952 per 0016954:0039376