Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Burndown graph internal error with closed issue #82

Open
cassianomonteiro opened this issue Jul 4, 2012 · 1 comment
Open

Burndown graph internal error with closed issue #82

cassianomonteiro opened this issue Jul 4, 2012 · 1 comment

Comments

@cassianomonteiro
Copy link

The burndown graph is working fine with all issues opened. But as soon as I closed one issue, I got Internal Error 500. My log shows this:

Processing ScrumblerSprintsController#burndown (for 10.3.14.33 at 2012-07-04 14:32:26) [GET]
  Parameters: {"project_id"=>"epb-ipad", "action"=>"burndown", "id"=>"2", "controller"=>"scrumbler_sprints"}

ArgumentError (odd number of arguments for Hash):
  vendor/plugins/redmine_scrumbler/app/controllers/scrumbler_sprints_controller.rb:174:in `[]'
  vendor/plugins/redmine_scrumbler/app/controllers/scrumbler_sprints_controller.rb:174:in `burndown_calc'
  vendor/plugins/redmine_scrumbler/app/controllers/scrumbler_sprints_controller.rb:121:in `burndown'
  config/initializers/mongrel.rb:62:in `dispatch_cgi'

Rendering C:/webserver/Redmine/public/500.html (500 Internal Server Error)

I´m using Redmine 1.4.4, with Scrumbler commit 1d8002f (redmine 1.4.x support from may 2nd).
Ruby version: 1.8.7
Rails version: 2.3.14

Gem list:

*** LOCAL GEMS ***

actionmailer (2.3.14)
actionpack (2.3.14)
activerecord (2.3.14)
activeresource (2.3.14)
activesupport (2.3.14)
bundler (1.1.3)
cgi_multipart_eof_fix (2.5.0)
coderay (1.0.6)
fastercsv (1.5.5, 1.5.4)
gem_plugin (0.2.3)
i18n (0.4.2)
json (1.6.6, 1.6.3)
mongrel (1.1.5 x86-mingw32)
mongrel_service (0.3.4 i386-mswin32)
mysql (2.8.1 x86-mingw32)
net-ldap (0.3.1)
pg (0.13.2 x86-mingw32)
rack (1.1.3, 1.1.1)
rails (2.3.14)
rake (0.9.2.2, 0.8.7)
rdoc (3.12)
rmagick (2.13.1)
ruby-openid (2.1.8)
sqlite3 (1.3.6 x86-mingw32, 1.3.5 x86-mingw32)
tzinfo (0.3.33)
win32-service (0.5.2 mswin32)
@cassianomonteiro
Copy link
Author

Turns out it was because of the ruby version 1.8.7. The Hash#[] method from 1.9.3 is able to take a 2-dimention array, but the one from 1.8.7 can´t do it.

I worked around that that by manually adding the items to the hash, as the code below (method burndown_calc, line 174). Sorry, but i´m not skilled with ruby, probably there is a much clever way to do it.

#    closed_issues = Hash[closed_issues.group_by(&:due_date).map {|k,v|
#      [k, v.inject(0.0) {|t,is|
#          t+= is.custom_value_for(ScrumblerIssueCustomField.points).try(:value).to_f }
#      ]}]

    closed_issues_array = closed_issues.group_by(&:due_date).map {|k,v|
      [k, v.inject(0.0) {|t,is|
          t+= is.custom_value_for(ScrumblerIssueCustomField.points).try(:value).to_f }
      ]}
    closed_issues = Hash.new
    closed_issues_array.each { |x| closed_issues[x[0]] = x[1] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant