Defect #15294
closedActiveRecord::DangerousAttributeError when cloning issue
0%
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)
Updated by Jean-Philippe Lang about 11 years ago
- Status changed from New to Needs feedback
- Resolution set to Cant reproduce
I can't reproduce and grep -r "delay" *
in activerecord gives nothing. Do you have any plugin or anything special?
Updated by Nicolas Rodriguez about 11 years ago
I have 20 plugins installed, but a
grep -rin --include=\*.rb 'delay' *in the plugin dir gives nothing...
Updated by Nicolas Rodriguez about 11 years ago
I think I found it.
I use Redmine Git Hosting with Sidekiq and Sidekiq has a 'delay' method https://github.com/mperham/sidekiq/wiki/Delayed-Extensions
When I remove Redmine Git Hosting from the plugin dir everything works fine.
I don't know how I can fix this... can you help me please?
Updated by Jean-Philippe Lang about 11 years ago
- Status changed from Needs feedback to Closed
- Resolution changed from Cant reproduce to Invalid
Thanks for the feedback but sorry, no technical support request here in the issue tracker.
Updated by Nicolas Rodriguez almost 11 years ago
I'm answering to myself : I've created a fork of the Sidekiq gem with renamed methods https://github.com/jbox-web/sidekiq
Updated by Devaroop Bhattacharya over 10 years ago
The above link is broken :(, I have created a fork of sidekiq to solve the problem and also submitted a pull request for ease in sidekiq configuration.
Please find them below:
Gem: https://github.com/devaroop/sidekiq
Instructions: https://github.com/mperham/sidekiq/pull/1674
Updated by Nicolas Rodriguez over 10 years ago
You should use this great plugin which already solves the problem ;)