Content
Attempting to create Work Packages give undefined method position error.
Added by Robert Ebright over 10 years ago
We have been trying to use OpenProject and had everything working and then sometime around the time of adding different types of Work Packages we started getting the following error.
NoMethodError (undefined method `position’ for #WorkPackage:0x000000095e9e40):
app/controllers/work_packages_controller.rb:144:in `create’
I’m a ruby newbie and so I have no real idea what to look at in terms of troubleshooting this. I see position throughout the code, but I’m not sure why this would be coming up. Also we had been able to post work packages just fine and are able to create other types of content on our openproject instance but not this.
Here is the complete log for this. Any help would be appreciated.
Started GET “/projects/openproject/work_packages/new_type?utf8=%E2%9C%93&authenticity_token=6rv%2FdZrYO4tiWSVFN8D5Y1I7nZfoZN46574gaFkxNmc%3D&work_package%5Btype_id%5D=2&work_package%5Bsubject%5D=&work_package%5Bparent_id%5D=&work_package%5Bdescription%5D=&work_package%5Bstatus_id%5D=1&work_package%5Bpriority_id%5D=15&work_package%5Bassigned_to_id%5D=&work_package%5Bresponsible_id%5D=&work_package%5Bcategory_id%5D=&work_package%5Bfixed_version_id%5D=&work_package%5Bstart_date%5D=&work_package%5Bdue_date%5D=&work_package%5Bestimated_hours%5D=&work_package%5Bdone_ratio%5D=0&attachments%5B1%5D%5Bdescription%5D=&send_notification=0&send_notification=1&commit=Create&authenticity_token=6rv%2FdZrYO4tiWSVFN8D5Y1I7nZfoZN46574gaFkxNmc%3D” for 166.137.xxx.xxx at 2014-05-16 19:06:30 +0000
Processing by WorkPackagesController#new_type as JS
Parameters: {“utf8”=>“✓”, “authenticity_token”=>“6rv/dZrYO4tiWSVFN8D5Y1I7nZfoZN46574gaFkxNmc=”, “work_package”=>{“type_id”=>“2”, “subject”=>“”, “parent_id”=>“”, “description”=>“”, “status_id”=>“1”, “priority_id”=>“15”, “assigned_to_id”=>“”, “responsible_id”=>“”, “category_id”=>“”, “fixed_version_id”=>“”, “start_date”=>“”, “due_date”=>“”, “estimated_hours”=>“”, “done_ratio”=>“0”}, “attachments”=>{“1”=>{“description”=>“”}}, “send_notification”=>“1”, “commit”=>“Create”, “project_id”=>“openproject”}
Rendered work_packages/_two_column_attributes.html.erb (0.2ms)
Rendered work_packages/_attributes.html.erb (45.7ms)
Rendered work_packages/new_type.html.erb (46.4ms)
Completed 200 OK in 72.4ms (Views: 45.2ms | ActiveRecord: 3.7ms)
Started POST “/projects/openproject/work_packages” for 166.137.xxx.xxx at 2014-05-16 19:06:44 +0000
Processing by WorkPackagesController#create as HTML
Parameters: {“utf8”=>“✓”, “authenticity_token”=>“6rv/dZrYO4tiWSVFN8D5Y1I7nZfoZN46574gaFkxNmc=”, “work_package”=>{“type_id”=>“2”, “subject”=>“Can’t Create Work Packages”, “parent_id”=>“”, “description”=>“Maybe deleting the custom field will fix this ?”, “status_id”=>“1”, “priority_id”=>“15”, “assigned_to_id”=>“”, “responsible_id”=>“”, “category_id”=>“”, “fixed_version_id”=>“”, “start_date”=>“”, “due_date”=>“”, “estimated_hours”=>“”, “done_ratio”=>“0”}, “attachments”=>{“1”=>{“description”=>“”}}, “send_notification”=>“1”, “commit”=>“Create”, “project_id”=>“openproject”}
Completed 500 Internal Server Error in 33.5ms
NoMethodError (undefined method `position’ for #WorkPackage:0x000000095e9e40):
app/controllers/work_packages_controller.rb:144:in `create’
Replies (3)
I can confirm this behaviour.
The error
@
NoMethodError (undefined method `position’ for #WorkPackage:0x0000000a4998a0):
app/controllers/work_packages_controller.rb:144:in `create’
@
is given when i try to add a work package.
Deleting custom types did not help.
Regards Stefan
Hello,
the attribute ‘position’ is introduced by the backlogs plugin so if you get this error it looks like you should run the migrations.
Got to the OpenProject root folder and run:
Best
Ratzi
Hi,
thanks for this fast answer. It really was the case that I didn’t run all the migrations.
Regards Stefan