Project

General

Profile

Problem with new Issue field

Added by Sergey Belov about 14 years ago

I have added new field to Issue. (it will be patch, not module)
Where I need to change to support saving new field into issue table?

When I submit new ticket or edit any it went wrong with error:

ArgumentError in IssuesController#edit

wrong number of arguments (1 for 2)

RAILS_ROOT: /var/lib/redmine

Application Trace | Framework Trace | Full Trace
/var/lib/redmine/app/models/issue.rb:318:in `visible?'
/var/lib/redmine/app/models/issue.rb:318:in `recipients'
/var/lib/redmine/app/models/issue.rb:318:in `reject!'
/var/lib/redmine/app/models/issue.rb:318:in `recipients'
/var/lib/redmine/app/models/mailer.rb:66:in `issue_edit'
/var/lib/redmine/app/models/journal_observer.rb:20:in `after_create'
/var/lib/redmine/app/models/journal.rb:43:in `save'
/var/lib/redmine/app/models/issue.rb:455:in `create_journal'
/var/lib/redmine/app/controllers/issues_controller.rb:196:in `edit'

Code from issues_controller.rb:

// This code is for issue attributes
if (@edit_allowed || !@allowed_statuses.empty?) && params[:issue]
      attrs = params[:issue].dup
      attrs.delete_if {|k,v| !UPDATABLE_ATTRS_ON_TRANSITION.include?(k) } unless @edit_allowed
      attrs.delete(:status_id) unless @allowed_statuses.detect {|s| s.id.to_s == attrs[:status_id].to_s}
      @issue.attributes = attrs
    end

Then below
call_hook(:controller_issues_edit_before_save, { :params => params, :issue => @issue, :time_entry => @time_entry, :journal => journal})

problem is that @issue has one more field


Replies (3)

RE: Problem with new Issue field - Added by Sergey Belov about 14 years ago

Anyone can help? I'm making new "private issue" patch for 0.9.3 and I think many people need it

RE: Problem with new Issue field - Added by Oleg Volkov about 14 years ago

Fix for patch:
s/visible/visible_private/

    (1-3/3)