Project

General

Profile

Actions

Defect #15294

closed

ActiveRecord::DangerousAttributeError when cloning issue

Added by Nicolas Rodriguez about 11 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

I'm running Redmine 2.3.3 :

Environment:
  Redmine version                2.3.2.stable
  Ruby version                   2.0.0-p247 (2013-06-27) [x86_64-linux]
  Rails version                  3.2.13
  Environment                    production
  Database adapter               Mysql2

When I clone an issue with 'copy' link and save it I get this error :

Completed 500 Internal Server Error in 441ms

ActiveRecord::DangerousAttributeError (delay is defined by ActiveRecord):
  app/models/issue_relation.rb:87:in `initialize'
  app/models/issue.rb:1230:in `new'
  app/models/issue.rb:1230:in `after_create_from_copy'
  app/models/issue.rb:159:in `create_or_update'
  app/controllers/issues_controller.rb:141:in `create'

A grep in Redmine app dir gives :

root:/data/redmine-repositories/jbox/redmine/app# grep -rin 'delay' *
models/issue_relation.rb:69:  validates_numericality_of :delay, :allow_nil => true
models/issue_relation.rb:143:      self.delay ||= 0
models/issue_relation.rb:145:      self.delay = nil
models/issue_relation.rb:158:    if (TYPE_PRECEDES == self.relation_type) && delay && issue_from &&
models/issue_relation.rb:160:      (issue_from.due_date || issue_from.start_date) + 1 + delay
views/issue_relations/create.js.erb:3:  $('#relation_delay').val('');
views/issue_relations/_form.html.erb:6:<%= l(:field_delay) %>: <%= f.text_field :delay, :size => 3 %> <%= l(:label_day_plural) %>
views/issue_relations/show.api.rsb:6:  api.delay @relation.delay
views/issue_relations/index.api.rsb:8:      api.delay relation.delay
views/issues/_relations.html.erb:18:    <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
views/issues/show.api.rsb:37:      api.relation(:id => relation.id, :issue_id => relation.issue_from_id, :issue_to_id => relation.issue_to_id, :relation_type => relation.relation_type, :delay => relation.delay)
views/issues/index.api.rsb:30:          api.relation(:id => relation.id, :issue_id => relation.issue_from_id, :issue_to_id => relation.issue_to_id, :relation_type => relation.relation_type, :delay => relation.delay)
Actions

Also available in: Atom PDF