プロジェクト

全般

プロフィール

Vote #75902

完了

Redmine::FieldFormat::IntFormat does not accept "real" Integer values

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

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

0%

予定工数:
category_id:
30
version_id:
80
issue_org_id:
18781
author_id:
118617
assigned_to_id:
1
comments:
2
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
82
ステータス-->[Closed]

説明

I had the Problem of setting the value of a custom field in my code
and therefore validating the new (calculated) value.
The CustomField had the format Redmine::FieldFormat::IntFormat.
The new value was a true Integer: 1
But the value was refused with the message that it's not a Number!

The Reason is, that Redmine::FieldFormat::IntFormat validates the value with RegExp:

value =~ /[+-]?\d+$/

which will not return true if value is not a String.
I understand, that "normally" values of custom fields will be set via forms
and so usually all values will be Strings.

But I think IntFormat's validation should accept real Integers also!


journals

--------------------------------------------------------------------------------
Fixed in r13863.
--------------------------------------------------------------------------------

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

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン3.0.0_80 にセット

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

いいね!0
いいね!0