2014-11-29 02:07 EST

View Issue Details Jump to Notes ] Wiki ]
IDProjectCategoryView StatusLast Update
0011951mantisbtcustom fieldspublic2012-08-22 18:12
ReporterSergiodf 
Assigned Toatrol 
PriorityimmediateSeverityblockReproducibilityalways
StatusclosedResolutionduplicate 
Product Version1.2.1 
Target VersionFixed in Version 
Summary0011951: Bug report page ask for custom fields not required nor displayed
DescriptionAfter upgrading to v1.2.1, we were unable to report bugs anymore: after submitting a new bug, an error is shown saying a custom field was not completed.
That field is not configured to be required, it is not even configured to be displayed.
TagsNo tags attached.
Attached Files
  • diff file icon 11951.diff (1,889 bytes) 2010-05-21 17:47 - 
    --- C:/Documents and Settings/SDelFranco/Escritorio/mantis/mantisbt-1.2.1-official/bug_report.php	Fri Apr 23 14:28:34 2010
    +++ H:/mantis/bug_report.php	Fri May 21 18:38:16 2010
    @@ -104,16 +104,23 @@
     		$t_def = custom_field_get_definition( $t_id );
     
     		# 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_LIST ||
    -				$t_def['type'] == CUSTOM_FIELD_TYPE_MULTILIST ||
    -				$t_def['type'] == CUSTOM_FIELD_TYPE_RADIO ) ) {
    +		if (	$t_def['require_report']
    +				&& (
    +					$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
    +				) && !gpc_isset_custom_field( $t_id, $t_def['type'] )
    +			) {
     			error_parameters( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ) );
     			trigger_error( ERROR_EMPTY_FIELD, ERROR );
     		}
    -		if ( !custom_field_validate( $t_id, gpc_get_custom_field( "custom_field_$t_id", $t_def['type'], NULL ) ) ) {
    +		if (	$t_def['display_report']
    +				&& !custom_field_validate(
    +						$t_id,
    +						gpc_get_custom_field( "custom_field_$t_id", $t_def['type'], NULL )
    +					) 
    +		) {
     			error_parameters( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ) );
     			trigger_error( ERROR_CUSTOM_FIELD_INVALID_VALUE, ERROR );
     		}
    @@ -136,7 +143,7 @@
     	# Handle custom field submission
     	foreach( $t_related_custom_field_ids as $t_id ) {
     		# Do not set custom field value if user has no write access.
    -		if( !custom_field_has_write_access( $t_id, $t_bug_id ) ) {
    +		if( !$t_def['display_report'] || !custom_field_has_write_access( $t_id, $t_bug_id ) ) {
     			continue;
     		}
     
    
    diff file icon 11951.diff (1,889 bytes) 2010-05-21 17:47 + 

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

-  Notes
User avatar

~0025583

Sergiodf (reporter)

The attached patch solves the problem.
User avatar

~0025584

Sergiodf (reporter)

Last edited: 2010-05-21 17:51

View 2 revisions

Oops... sorry. This is duplicate of 0011684.

User avatar

~0025586

atrol (developer)

Thanks for the patch
+  Notes

- Issue History
Date Modified Username Field Change
2010-05-21 17:42 Sergiodf New Issue
2010-05-21 17:47 Sergiodf File Added: 11951.diff
2010-05-21 17:47 Sergiodf Note Added: 0025583
2010-05-21 17:51 Sergiodf Note Added: 0025584
2010-05-21 17:51 Sergiodf Note Edited: 0025584 View Revisions
2010-05-21 18:33 atrol Note Added: 0025586
2010-05-21 18:33 atrol Relationship added duplicate of 0011684
2010-05-21 18:33 atrol Status new => resolved
2010-05-21 18:33 atrol Resolution open => not fixable
2010-05-21 18:33 atrol Assigned To => atrol
2010-09-19 03:12 dhx Status resolved => closed
2012-08-22 18:12 atrol Resolution not fixable => duplicate
+ Issue History