Project

General

Profile

Actions

Defect #7085

closed

"create project" with empty trackers list gives "NoMethodError (undefined method `each' for nil:NilClass)"

Added by Alex Last over 13 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Start date:
2010-12-09
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

sending this xml to redmine REST API (last Trunk version of Redmine code):

<?xml version="1.0" encoding="UTF-8"?>
<project>
  <name>project number 1291862021991</name>
  <identifier>projkey1291862021991</identifier>
  <trackers/>
</project>

Result:

server error 500

server log contains:

Processing ProjectsController#index (for 192.168.0.13 at 2010-12-08 18:33:31) [GET]
  Parameters: {"action"=>"index", "controller"=>"projects"}
Rendering template within layouts/base
Rendering projects/index
Completed in 57ms (View: 30, DB: 16) | 200 OK [http://academ/projects]

Processing ProjectsController#create to xml (for 192.168.0.13 at 2010-12-08 18:33:44) [POST]
  Parameters: {"format"=>"xml", "action"=>"create", "project"=>{"name"=>"project number 1291862021991", "trackers"=>nil, "identifier"=>"projkey1291862021991"}, "controller"=>"projects", "key"=>"01d7692c218a74d60d25d8eb5f62874a22ef8599"}

NoMethodError (undefined method `each' for nil:NilClass):
  app/models/project.rb:88:in `initialize'
  app/controllers/projects_controller.rb:75:in `new'
  app/controllers/projects_controller.rb:75:in `create'
  /usr/lib/ruby/1.8/mongrel/rails.rb:76:in `process'
  /usr/lib/ruby/1.8/mongrel/rails.rb:74:in `synchronize'
  /usr/lib/ruby/1.8/mongrel/rails.rb:74:in `process'
  /usr/lib/ruby/1.8/mongrel.rb:159:in `process_client'
  /usr/lib/ruby/1.8/mongrel.rb:158:in `each'
  /usr/lib/ruby/1.8/mongrel.rb:158:in `process_client'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `run'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `initialize'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `new'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `run'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `initialize'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `new'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `run'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:282:in `run'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:281:in `each'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:281:in `run'
  /usr/lib/ruby/1.8/mongrel/command.rb:212:in `run'

Rendering /opt/redmine/public/500.html (500 Internal Server Error)

Actions

Also available in: Atom PDF