View Issue Details

IDProjectCategoryView StatusLast Update
0022309mantisbtdocumentationpublic2017-03-12 19:23
Reporterdidaquis Assigned Toatrol  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.0-beta.1 
Target Version1.3.7Fixed in Version1.3.7 
Summary0022309: Example of Regular expression on documentation not work on MantisBT
Description

Example of Regular expression on documentation not work on MantisBT.
On section "6.8.3 Manage Custom Fields" of administrator documentation says:


All fields are also compared against the regular expression. If the value matches the expression, then the
value is stored. For example, the expression "/^-?([0-9])*$/" can be used to constrain an integer.

If you copy-paste the regular expression in field "Regular expression" when you configure a custom field, configuration seems correct. But when you try to use the field (for example creating a new issue) an error appears with this description:

SYSTEM WARNING
'preg_match(): Unknown modifier '^'' in 'C:\wamp\www\mantisbt_210dev\core\custom_field_api.php' line 1084

Maybe is a good idea change the example of regular expression in documentation and put another valid example.

Steps To Reproduce
  • Create a new custom field
  • configure regular expressión field with this value (provided on documentation): "/^-?([0-9])*$/"
  • Try to use the field
TagsNo tags attached.

Activities

didaquis

didaquis

2017-02-03 06:01

reporter   ~0055470

I suggest this examples:


For integer major than 0 use:
[1-9][0-9]*

dregad

dregad

2017-02-03 06:54

developer   ~0055471

I don't have time to check, but I believe the code is already adding the /delimiter around the regex prior to passing it on to preg_match().

atrol

atrol

2017-02-03 07:00

developer   ~0055472

but I believe the code is already adding the / delimiter

Right, we add the delimiter in code.

atrol

atrol

2017-02-03 07:12

developer   ~0055473

PR https://github.com/mantisbt/mantisbt/pull/1016

Related Changesets

MantisBT: master-1.3.x 8dd089b6

2017-02-03 02:10

atrol

Committer: dregad


Details Diff
Correct documentation of regular expression for custom fields

Fixes 0022309
Affected Issues
0022309
mod - docbook/Admin_Guide/en-US/Page_Descriptions.xml Diff File