Defect #20270

Undefined method value_was for TimeEntryCustomField

Added by S B almost 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:


Category:Custom fields
Target version:-
Resolution:Invalid Affected version:3.0.3


When trying to use a plugin (WorkTime from I have an internal error only if I have a time entry custom field.
I post the bug here because the error occured in Redmine core and not in plugin code.
I also posted the bug on r-lab bugtraker :

Started GET "/redmine/work_time/show/my-project-id?day=8&month=7&prj=false&user=7&year=2015" for at 2015-07-08 09:17:40 +0200
Processing by WorkTimeController#show as HTML
  Parameters: {"day"=>"8", "month"=>"7", "prj"=>"false", "user"=>"7", "year"=>"2015", "id"=>"my-project-id"}
  Current user: myuserid (id=7)
  Rendered plugins/redmine_work_time/app/views/work_time/_select_project.html.erb (17.8ms)
  Rendered plugins/redmine_work_time/app/views/work_time/_select_user.html.erb (1.7ms)
  Rendered plugins/redmine_work_time/app/views/work_time/_user_month_table.html.erb (33.9ms)
  Rendered plugins/redmine_work_time/app/views/work_time/_user_day_table.html.erb (17.5ms)
  Rendered plugins/redmine_work_time/app/views/work_time/show.html.erb within layouts/base (73.9ms)
Completed 500 Internal Server Error in 143ms (ActiveRecord: 9.8ms)

ActionView::Template::Error (undefined method `value_was' for #<TimeEntryCustomField:0x0000000b448c60>):
    166:       nil
    167:     end
    168:   %>
    169:      <td><%= custom_field_tag "new_time_entry["+issue_id.to_s+"][0]", cf %></td>
    170:   <% end %>
    171: </tr>
    172: <%
  lib/redmine/field_format.rb:615:in `possible_custom_value_options'
  lib/redmine/field_format.rb:484:in `select_edit_tag'
  lib/redmine/field_format.rb:454:in `edit_tag'
  app/helpers/custom_fields_helper.rb:73:in `custom_field_tag'

It seems that a custom field of type TimeEntryCustomField does not have the value_was method.

My configuration :

  Redmine version                3.0.3.stable
  Ruby version                   1.9.3-p448 (2013-06-27) [x86_64-linux]
  Rails version                  4.2.1
  Environment                    production
  Database adapter               Mysql2
  Subversion                     1.6.17
Redmine plugins:
  redmine_base_deface            0.0.1
  redmine_custom_workflows       0.1.0
  redmine_latex_mathjax          0.1.0
  redmine_maintenance_mode       2.0.1
  redmine_work_time              0.3.0
  redmine_workflow_enhancements  0.4.0


#1 Updated by Mischa The Evil almost 7 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

S B wrote:

I post the bug here because the error occured in Redmine core and not in plugin code.

The error is caused by the plugin. The error cannot be fixed in core. As such it should be fixed downstream. Closing this issue accordingly.


Also available in: Atom PDF