プロジェクト

全般

プロフィール

Vote #79416

未完了

Regular expression for Long text formatted custom fields does not work multiline

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Custom fields_14
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
14
version_id:
0
issue_org_id:
29195
author_id:
356187
assigned_to_id:
0
comments:
0
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
141
ステータス-->[New]

説明

When using custom fields with format Long text, the Regular expression does not fully validate the field, as it seems to not be working multiline and global.

Using our case as example for this issue:

We want to validate a field named Steps to reproduce. We use the following regex:

(([1-9]+[0-9]*\. [A-Z]+.*?(\n|$))+)

And the following field Default value as a template:

1. Start the application
2. 
. Observe the issue

The template by itself without modification by the issue reporter should not validate. A valid example of a correct field would be:

1. Start the application
2. Go to "Help"
3. Click "About"
4. Observe the issue

However, Redmine only validates the first line of the field. If the first line line does not pass the regex test, Redmine correctly complains "Steps To Reproduce is invalid". But it does ignores everything in the following lines.

There is no workaround that could work by rewriting the regular expression.

Possible solutions:

  1. Make all Long text custom fields regex global and multiline by default
  2. Add additional checkboxes in custom field edit page with Multiline and Global to complement the Regular expression field

Environments:

We can confirm this issue in both our current production environment as well as our test environment (the version of which will be migrating our production environment soon).

Production Environment:
  Redmine version                3.2.1.stable
  Ruby version                   2.3.4-p301 (2017-03-30) [x86_64-linux-gnu]
  Rails version                  4.2.6
  Environment                    production
  Database adapter               Mysql2
Test Enviroment:
Environment:
  Redmine version                3.4.2.stable
  Ruby version                   2.3.4-p301 (2017-03-30) [x86_64-linux-gnu]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               Mysql2

Admin Redmine さんが約4年前に更新

  • カテゴリCustom fields_14 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0