View Issue Details

IDProjectCategoryView StatusLast Update
0012353mantisbtcustom fieldspublic2011-08-05 02:25
Reporterwmalgadey Assigned Toatrol  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Version1.2.2 
Summary0012353: Not requiered custom field got validated on new issue
Description

I created a custom field (MultiSelect) with following options:

Default Value: (one of the MultiSelect-Options)

Display When Reporting Issues: false
Display When Updating Issues: true
Display When Resolving Issues: true
Display When Closing Issues: true

Required On Report: false
Required On Update: false
Required On Resolve: true
Required On Close: true

The Custom Field is linkt to the active project

Now I created a new Issue. Filled the non optional fields (categorie, title, description) and saved. I expected that the issue is created with the default value in my custom field.

But I got an error reporting the field "xxx" could not be empty!

Additional Information

I changed the file bug_report.php as following:

--- bug_report.php Wed Sep 15 14:27:24 2010
+++ bug_report.php Wed Sep 15 14:27:26 2010
@@ -103,10 +103,12 @@
foreach( $t_related_custom_field_ids as $t_id ) {
$t_def = custom_field_get_definition( $t_id );

  • if (! $t_def['require_report'])
  • continue;
  • # Produce an error if the field is required but wasn't posted
    if ( !gpc_isset_custom_field( $t_id, $t_def['type'] ) &&
  • ( $t_def['require_report'] ||
  • $t_def['type'] == CUSTOM_FIELD_TYPE_ENUM ||
  • ( $t_def['type'] == CUSTOM_FIELD_TYPE_ENUM ||
    $t_def['type'] == CUSTOM_FIELD_TYPE_LIST ||
    $t_def['type'] == CUSTOM_FIELD_TYPE_MULTILIST ||
    $t_def['type'] == CUSTOM_FIELD_TYPE_RADIO ) ) {
    @@ -141,7 +143,7 @@
    }

    $t_def = custom_field_get_definition( $t_id );
  • if( !custom_field_set_value( $t_id, $t_bug_id, gpc_get_custom_field( "customfield$t_id", $t_def['type'], '' ), false ) ) {
  • 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 ) ) {
    error_parameters( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ) );
    trigger_error( ERROR_CUSTOM_FIELD_INVALID_VALUE, ERROR );
    }

now only custom fields "Required On Report" are beeing checked and the default Values for those custom fields are used again.

something which realy bothers me is that the git-repository does not show those errors, but the actual 1.2.3 download did contain it!

TagsNo tags attached.

Relationships

duplicate of 0011684 closedvboctor Incorrect error "A necessary field "MyField" was empty. Please recheck your inputs." when submitting new issue 

Activities

There are no notes attached to this issue.