View Issue Details

IDProjectCategoryView StatusLast Update
0005181mantisbtcustom fieldspublic2008-03-29 01:01
Reportergeha78 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version0.19.2 
Summary0005181: Unnecessary Regular Expression validation produces error
Description

If a 'Regular Expression' for a custom field is set and 'Display When Reporting Issues' is set to false, mantis tries to validate and store the value of the custom field anyways.
Since no value could be entered for the field, this produces the error 'Invalid value for field'.
I think this is fixed by just changing 2 lines in 'bug_report.php':
In lines 91 and 116 ( see Additional Information ) I added the expression
'$t_def['display_report'] && '
at the beginning of the if-statement and it works fine.

Additional Information

file: 'bug_report.php'
line 91:
if ( !custom_field_validate( $t_id, gpc_get_custom_field( "customfield$t_id", $t_def['type'], $t_def['default_value'] ) ) ) {

line 116:
if( custom_field_set_value( $t_id, $t_bug_id, gpc_get_custom_field( "customfield$t_id", $t_def['type'], $t_def['default_value'] ) ) ) {

Tagspatch

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2005-01-29 11:52 geha78 New Issue
2008-03-29 01:01 vboctor Status new => acknowledged
2008-03-29 01:01 vboctor Tag Attached: patch