View Issue Details

IDProjectCategoryView StatusLast Update
0022309mantisbtdocumentationpublic2017-03-12 19:23
ReporterdidaquisAssigned 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 07:10:22

atrol


Committer: dregad Details Diff
Correct documentation of regular expression for custom fields

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

Issue History

Date Modified Username Field Change
2017-02-03 05:50 didaquis New Issue
2017-02-03 06:01 didaquis Note Added: 0055470
2017-02-03 06:54 dregad Status new => acknowledged
2017-02-03 06:54 dregad Note Added: 0055471
2017-02-03 06:54 dregad Note View State: 0055471: public
2017-02-03 07:00 atrol Note Added: 0055472
2017-02-03 07:03 atrol Assigned To => atrol
2017-02-03 07:03 atrol Status acknowledged => assigned
2017-02-03 07:04 atrol Category custom fields => documentation
2017-02-03 07:04 atrol Target Version => 1.3.7
2017-02-03 07:04 atrol Description Updated View Revisions
2017-02-03 07:12 atrol Note Added: 0055473
2017-02-03 08:14 dregad Changeset attached => MantisBT master-1.3.x 8dd089b6
2017-02-03 08:14 dregad Assigned To atrol => dregad
2017-02-03 08:14 dregad Status assigned => resolved
2017-02-03 08:14 dregad Resolution open => fixed
2017-02-03 08:14 dregad Fixed in Version => 1.3.7
2017-02-03 08:19 dregad Product Version 2.1.0 => 1.3.0-beta.1
2017-02-03 08:20 dregad Assigned To dregad => atrol
2017-03-12 19:23 vboctor Status resolved => closed