プロジェクト

全般

プロフィール

Vote #75382

完了

Error when editing custom field with blank min_length or max_length

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

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

0%

予定工数:
category_id:
13
version_id:
87
issue_org_id:
17446
author_id:
40388
assigned_to_id:
1
comments:
6
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
77
ステータス-->[Closed]

説明

Hi,

after adding a custom field to my time tracking, adding and editing time entries always fails when this custom field has been filled.
I've tried 2 different custom field, both lead to the exact same error:

  • Custom field of type 'Integer', not mandatory, added to Spent Time
  • Custom field of type 'Boolean', not mandatory (obviously), added to Spent Time

I can add the fields without any issue, and when I leave them empty, I can still add time entries, but when either (or both) custom field is filled, I get an 500 internal server error.

The error log shows the following details:

Started PUT "/projects/l-t-media/time_entries/46" for 213.127.211.250 at 2014-07-11 09:29:00 +0200
Processing by TimelogController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"", "back_url"=>"http:///projects/myproject/time_entries", "time_entry"=>{"issue_id"=>"", "spent_on"=>"2014-07-10", "hours"=>"1.0", "comments"=>"Reistijd Nijmegen-Arnhem-Nijmegen", "activity_id"=>"12", "custom_field_values"=>{"6"=>"64"}}, "commit"=>"Bewaren", "project_id"=>"myproject", "id"=>"47"}
  Current user: Rinck (id=1)
Completed 500 Internal Server Error in 11.7ms

NoMethodError (undefined method `>' for nil:NilClass):
  app/models/custom_field.rb:355:in `validate_field_value_format'
  app/models/custom_field.rb:334:in `validate_field_value'
  app/models/custom_field_value.rb:46:in `validate_value'
  lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb:126:in `each'
  lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb:126:in `validate_custom_field_values'
  app/controllers/timelog_controller.rb:155:in `update'
Environment:
  Redmine version                2.4.2.stable
  Ruby version                   1.9.3-p0 (2011-10-30) [x86_64-linux]
  Rails version                  3.2.16
  Environment                    production
  Database adapter               Mysql2
SCM:
  Filesystem                     
Redmine plugins:
  no plugin installed

Additional info:

Since I installed Redmine from the default Ubuntu 12.04 repositories, it is not easy for me to upgrade to the latest version to test it there. I do have an older version of Redmine running on a different server (running redmine 1.3.2) and that instance has the exact same custom fields and it works like a charm.

Hoping someone can get this fixed! :)


journals

Sorry about messing up the formatting, I missed a closing /pre tag and cannot edit the message myself..
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
R Sonnenberg wrote:
> Sorry about messing up the formatting, I missed a closing /pre tag and cannot edit the message myself..
Fixed that for you :-)
--------------------------------------------------------------------------------
This error is fixed in 2.5. You should be able to prevent that by editing your custom fields and making sure that min and max lengths are not blank. Instead, set them to 0.
--------------------------------------------------------------------------------
I just added the min/max values (0) and that fixes the problem! Thanks for the work-around; I guess this issue can be closed now?
--------------------------------------------------------------------------------
Fix is committed in 2.4-stable (r13328), thanks for the feedback!
--------------------------------------------------------------------------------

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

いいね!0
いいね!0