プロジェクト

全般

プロフィール

Vote #76327

完了

Issue validation fails if % done field is deactivated

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

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

0%

予定工数:
category_id:
2
version_id:
96
issue_org_id:
19731
author_id:
126741
assigned_to_id:
1
comments:
8
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
94
ステータス-->[Closed]

説明

Creating a new issue fails with a validation message "% done is not valid" when then field has been removed for the tracker.

Temporarely solved the problem by changing issue.rb:


  def clear_disabled_fields
    if tracker
      tracker.disabled_core_fields.each do |attribute|
        send "#{attribute}=", nil unless attribute == "done_ratio"
      end
    end
  end
Environment:
  Redmine version                3.0.2.stable.14229
  Ruby version                   1.9.3-p484 (2013-11-22) [x86_64-linux]
  Rails version                  4.2.1
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.8
  Git                            1.9.1
  Filesystem
Redmine plugins:
  no plugin installed

journals

--------------------------------------------------------------------------------
Hi,
The done_ratio column is not null (mysql) in my database.
So, I change issue.rb this way
<pre><code class="ruby">
validates_inclusion_of :done_ratio, :in => 0..100, :if => Proc.new {|issue| issue.done_ratio=0 unless issue.disabled_core_fields.include?(:done_ratio); issue.disabled_core_fields.include?(:done_ratio)}
</code></pre>

Hope this helps.
--------------------------------------------------------------------------------
Where do you make the above edit? Does it need to be compiled?
--------------------------------------------------------------------------------
Hi,
the change is done to the file
source:tags/3.0.2/app/models/issue.rb

My change is done on the line 71.
The change done by Dominik Brumm is on the line 1591

After changing that file, restart the server.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Fixed in r14241, thanks for pointing this out.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,19777,Ticket update/create fails with "% Done is not included in the list" even when this field not enabled

Admin Redmine さんが3年以上前に更新

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

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

いいね!0
いいね!0