プロジェクト

全般

プロフィール

Vote #79041

完了

No validation errors when entering an invalid "Estimate hours" value

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

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

0%

予定工数:
category_id:
2
version_id:
136
issue_org_id:
27881
author_id:
332
assigned_to_id:
0
comments:
5
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

This problem was reported as a part of #12955 by "Daniel Felix":/users/61731 five years ago. I confirmed that the latest versions of Redmine (3.4 and trunk) are still affected.

The helper for the estimated time doesn't check the correctness of the string. For example, you can define hours by 2h30m to get 2.5 or 3h5m to get 3.08 as timevalue. But if you enter abc or 3j (misstyped) the string isn't checked. The issue just returns "update successfully" and sets the estimated time to nil. The string should be checked and should raise some error, if the input isn't correct.


journals

--------------------------------------------------------------------------------
I found a very similar fix r2251 (#2465). The following workaround should work.

<pre><code class="diff">
Index: app/models/issue.rb
===================================================================
--- app/models/issue.rb (revision 17140)
+++ app/models/issue.rb (working copy)
@@ -440,7 +440,7 @@
end

def estimated_hours=(h)
- write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
+ write_attribute :estimated_hours, (h.is_a?(String) ? (h.to_hours || h) : h)
end

safe_attributes 'project_id',
</code></pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Attaching a patch file. Setting target version to 3.3.6.
--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------


related_issues

relates,Closed,12955,Misbehaviour in estimated time validation
relates,Closed,2465,Spent time error

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

  • カテゴリIssues_2 にセット
  • 対象バージョン3.3.6_136 にセット

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

いいね!0
いいね!0