View Issue Details

IDProjectCategoryView StatusLast Update
0003526mantisbtcustom fieldspublic2019-09-26 16:41
Reporterchrisj Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
Platformi386OSLinux/KDEOS VersionSuSE/3.1.4
Summary0003526: Custom field regular expression doesn
Description

I created a custom field (Library Version) and added the following regular expression to the field:
^[0-9]{1,2}(.[0-9]{1,2}(.[0-9]{1,2})?)?$

When creating a new bug, entering an invalid value (such as 1.2.3.4) into the field and hitting 'Submit' correctly generates the message "APPLICATION ERROR 0001303 Invalid value for field". However, a bug record is still created with an empty 'Library Version' field. If the user hits the 'Back' button and fixes the problem and resubmits, a second bug record is created, leaving two bug reports for the same bug, one of which has an invalid custom field.

Steps To Reproduce

Create custom string field with regular expression.
Link custom string field to a project.
Submit a new bug using an invalid string for the string field.
Click 'View Bugs' to see extra bug record.

TagsNo tags attached.

Relationships

duplicate of 0016952 new When reporting issue receive error on custom field, but issue is still created 

Activities

vboctor

vboctor

2004-02-03 14:21

manager   ~0004943

Last edited: 2011-12-11 21:52

The problem is that the report bug does the following:

  • Adds the bug
  • Attaches any files
  • Sets the custom fields (errors are triggered here!)

So, if the custom field validation yields an error, then the bug is already added! There are two options:

  • Delete the bug if an error is found (in this case no creation/deletion notifications are to be sent. Problem: skips a bug id, probably less efficient.
  • Validate the custom fields before adding the bug. Problem: will not solve the case where attaching a file causes an error.
obstbaum80

obstbaum80

2011-11-14 09:57

reporter   ~0030231

Last edited: 2011-12-11 21:52

How about performing the validations via javascript before even submitting the bug?