drakontia/redmine_charts

TypeError (can't convert Array into Hash)

Osndok opened this issue · 4 comments

Hello.

I have been trying to get your rm-1.4.x / devel branch working, and have run into a problem:

TypeError (can't convert Array into Hash):
  vendor/plugins/redmine_charts/app/controllers/charts_controller.rb:53:in `merge'
  vendor/plugins/redmine_charts/app/controllers/charts_controller.rb:53:in `index'
  passenger (3.0.12) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'

At first I thought this would solve the problem, but it does not:

diff --git a/app/controllers/charts_controller.rb b/app/controllers/charts_controller.rb
index dda0438..4a7fcd7 100644
--- a/app/controllers/charts_controller.rb
+++ b/app/controllers/charts_controller.rb
@@ -32,7 +32,7 @@ class ChartsController < ApplicationController
       @grouping_options = Hash.new
     end
 
-    @textconditions_options = []
+    @textconditions_options = Hash.new
 
     unless get_conditions_options.empty?
       @conditions_options = RedmineCharts::ConditionsUtils.to_options(@project, get_conditions_options)

Unfortunately, I am not familiar enough with ruby to diagnose the error :(

If this might be a simple problem, do you think that you could help? if it is a hard problem (like ruby 1.8 compatibility), I understand.

you are using ruby 1.8?
please try using ruby 1.9

Hello,

I fix the problem.
Please use RM1.4.x branch or RM2.0.x branch.

Hi drakontia,

I have updated to the latest RM1.4.x version (tagged v0.1.5), and the problem is fixed!

This is much better than what I did to work around the problem, thanks!

I'm glad to be of service.
Though, Redmine will not support rails ver.2 (ver 1.4.7 is last release supported rails ver.2), and I also.
So, please consider the possibility of updating to Redmine ver.2.2, if you can do it.
Redmine charts is already supported latest Redmine.
Thanks.