samchen2009 / ekanban

a kanban plugin for redmine
103 stars 41 forks source link

undefined method `find_all_by_tracker_id' [Redmine 3.0.1] #86

Open crick3t opened 9 years ago

crick3t commented 9 years ago

Hi,

We have tried to install this plugin with Redmine 3.0.1 and we almost done it (after spending a day on the install... :) ). Unfortunately we stuck at an error (see below).

Does anyone know what is the issue here and how to solve it. Thanks in advance.

Started GET "/redmine/kanban_states/setup" for 127.0.0.1 at 2015-03-31 16:34:47 +0100 Processing by KanbanStatesController#setup as HTML Current user: admin (id=1) Rendered plugins/ekanban/app/views/kanban_states/_state_list.html.haml (4.0ms) Rendered plugins/ekanban/app/views/common/_tabs.html.erb (5.0ms) Rendered plugins/ekanban/app/views/kanban_states/index.html.haml within layouts/base (7.0ms) Completed 500 Internal Server Error in 12ms

ActionView::Template::Error (undefined method find_all_by_tracker_id' for #<Class:0x5ca8cb8>): 3: - trackers = Tracker.all 4: - trackers.each do |t| 5: %h3= "Tracker #{t.name}" 6: - states = KanbanState.find_all_by_tracker_id(t.id) 7: - if !states.nil? 8: %table{:id => "kanban_state_#{t.id}",:class => "list"} 9: %thead activerecord (4.2.0) lib/active_record/dynamic_matchers.rb:26:inmethod_missing' plugins/ekanban/app/views/kanban_states/_state_list.html.haml:6:in block in _plugins_ekanban_app_views_kanban_states__state_list_html_haml___350479890_47900868' D:ineach' D:in each' plugins/ekanban/app/views/kanban_states/_state_list.html.haml:4:in_plugins_ekanban_app_views_kanban_statesstate_list_htmlhaml350479890_47900868' actionview (4.2.0) lib/action_view/template.rb:145:in block in render' activesupport (4.2.0) lib/active_support/notifications.rb:166:ininstrument' actionview (4.2.0) lib/action_view/template.rb:333:in instrument' actionview (4.2.0) lib/action_view/template.rb:143:inrender' actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:339:in render_partial' actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:310:inblock in render' actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:in block in instrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:inblock in instrument' activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:in instrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:ininstrument' actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:in instrument' actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:309:inrender' actionview (4.2.0) lib/action_view/renderer/renderer.rb:47:in render_partial' actionview (4.2.0) lib/action_view/renderer/renderer.rb:21:inrender' actionview (4.2.0) lib/action_view/helpers/rendering_helper.rb:32:in render' haml (4.0.6) lib/haml/helpers/action_view_mods.rb:12:inrender_with_haml' plugins/ekanban/app/views/common/_tabs.html.erb:23:in block in _plugins_ekanban_app_views_common__tabs_html_erb__88145661_50908020' plugins/ekanban/app/views/common/_tabs.html.erb:22:ineach' plugins/ekanban/app/views/common/_tabs.html.erb:22:in _plugins_ekanban_app_views_common__tabs_html_erb__88145661_50908020' actionview (4.2.0) lib/action_view/template.rb:145:inblock in render' activesupport (4.2.0) lib/active_support/notifications.rb:166:in instrument' actionview (4.2.0) lib/action_view/template.rb:333:ininstrument' actionview (4.2.0) lib/action_view/template.rb:143:in render' actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:339:inrender_partial' actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:310:in block in render' actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:inblock in instrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:in block in instrument' activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:in instrument' actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:ininstrument' actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:309:in render' actionview (4.2.0) lib/action_view/renderer/renderer.rb:47:inrender_partial' actionview (4.2.0) lib/action_view/renderer/renderer.rb:21:in render' actionview (4.2.0) lib/action_view/helpers/rendering_helper.rb:32:inrender' haml (4.0.6) lib/haml/helpers/action_view_mods.rb:10:in block in render_with_haml' haml (4.0.6) lib/haml/helpers.rb:89:innon_haml' haml (4.0.6) lib/haml/helpers/action_view_mods.rb:10:in render_with_haml' plugins/ekanban/app/views/kanban_states/index.html.haml:3:in_plugins_ekanban_app_views_kanban_states_index_html_haml__975218400_50875932' actionview (4.2.0) lib/action_view/template.rb:145:in block in render' activesupport (4.2.0) lib/active_support/notifications.rb:166:ininstrument' actionview (4.2.0) lib/action_view/template.rb:333:in instrument' actionview (4.2.0) lib/action_view/template.rb:143:inrender' actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:54:in block (2 levels) in render_template' actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:inblock in instrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:in block in instrument' activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:in instrument' actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:ininstrument' actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:53:in block in render_template' actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:61:inrender_with_layout' actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:52:in render_template' actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:14:inrender' actionview (4.2.0) lib/action_view/renderer/renderer.rb:42:in render_template' actionview (4.2.0) lib/action_view/renderer/renderer.rb:23:inrender' actionview (4.2.0) lib/action_view/rendering.rb:100:in _render_template' actionpack (4.2.0) lib/action_controller/metal/streaming.rb:217:in_render_template' actionview (4.2.0) lib/action_view/rendering.rb:83:in render_to_body' actionpack (4.2.0) lib/action_controller/metal/rendering.rb:32:inrender_to_body' actionpack (4.2.0) lib/action_controller/metal/renderers.rb:37:in render_to_body' actionpack (4.2.0) lib/abstract_controller/rendering.rb:25:inrender' actionpack (4.2.0) lib/action_controller/metal/rendering.rb:16:in render' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:41:inblock (2 levels) in render' activesupport (4.2.0) lib/active_support/core_ext/benchmark.rb:12:in block in ms' D:/Bitnami_Redmine/ruby/lib/ruby/2.0.0/benchmark.rb:296:inrealtime' activesupport (4.2.0) lib/active_support/core_ext/benchmark.rb:12:in ms' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:41:inblock in render' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:84:in cleanup_view_runtime' activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:25:incleanup_view_runtime' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:40:in render' plugins/ekanban/app/controllers/kanban_states_controller.rb:28:insetup' actionpack (4.2.0) lib/action_controller/metal/implicit_render.rb:4:in send_action' actionpack (4.2.0) lib/abstract_controller/base.rb:198:inprocess_action' actionpack (4.2.0) lib/action_controller/metal/rendering.rb:10:in process_action' actionpack (4.2.0) lib/abstract_controller/callbacks.rb:20:inblock in process_action' activesupport (4.2.0) lib/active_support/callbacks.rb:117:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:117:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:234:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:234:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:92:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:92:in _run_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:734:in_run_process_action_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (4.2.0) lib/abstract_controller/callbacks.rb:19:inprocess_action' actionpack (4.2.0) lib/action_controller/metal/rescue.rb:29:in process_action' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:31:inblock in process_action' activesupport (4.2.0) lib/active_support/notifications.rb:164:in block in instrument' activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:in instrument' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:30:inprocess_action' actionpack (4.2.0) lib/action_controller/metal/params_wrapper.rb:250:in process_action' activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:18:inprocess_action' actionpack (4.2.0) lib/abstract_controller/base.rb:137:in process' actionview (4.2.0) lib/action_view/rendering.rb:30:inprocess' actionpack (4.2.0) lib/action_controller/metal.rb:195:in dispatch' actionpack (4.2.0) lib/action_controller/metal/rack_delegation.rb:13:indispatch' actionpack (4.2.0) lib/action_controller/metal.rb:236:in block in action' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:incall' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:in dispatch' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:42:inserve' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:43:in block in serve' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:ineach' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in serve' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:802:incall' rack-openid (1.4.2) lib/rack/openid.rb:98:in call' request_store (1.0.5) lib/request_store/middleware.rb:9:incall' rack (1.6.0) lib/rack/etag.rb:24:in call' rack (1.6.0) lib/rack/conditionalget.rb:25:incall' rack (1.6.0) lib/rack/head.rb:13:in call' actionpack-xml_parser (1.0.1) lib/action_dispatch/xml_params_parser.rb:16:incall' actionpack (4.2.0) lib/action_dispatch/middleware/params_parser.rb:27:in call' actionpack (4.2.0) lib/action_dispatch/middleware/flash.rb:260:incall' rack (1.6.0) lib/rack/session/abstract/id.rb:225:in context' rack (1.6.0) lib/rack/session/abstract/id.rb:220:incall' actionpack (4.2.0) lib/action_dispatch/middleware/cookies.rb:560:in call' activerecord (4.2.0) lib/active_record/query_cache.rb:36:incall' activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in call' actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:inblock in call' activesupport (4.2.0) lib/active_support/callbacks.rb:88:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:88:in_run_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:734:in _run_call_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (4.2.0) lib/action_dispatch/middleware/remote_ip.rb:78:incall' actionpack (4.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in call' actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:incall' railties (4.2.0) lib/rails/rack/logger.rb:38:in call_app' railties (4.2.0) lib/rails/rack/logger.rb:20:inblock in call' activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in block in tagged' activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:intagged' activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in tagged' railties (4.2.0) lib/rails/rack/logger.rb:20:incall' actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in call' rack (1.6.0) lib/rack/methodoverride.rb:22:incall' rack (1.6.0) lib/rack/runtime.rb:18:in call' activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:incall' actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in call' rack (1.6.0) lib/rack/sendfile.rb:113:incall' railties (4.2.0) lib/rails/engine.rb:518:in call' railties (4.2.0) lib/rails/application.rb:164:incall' railties (4.2.0) lib/rails/railtie.rb:194:in public_send' railties (4.2.0) lib/rails/railtie.rb:194:inmethod_missing' rack (1.6.0) lib/rack/urlmap.rb:66:in block in call' rack (1.6.0) lib/rack/urlmap.rb:50:ineach' rack (1.6.0) lib/rack/urlmap.rb:50:in call' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:82:inblock in pre_process' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:80:in catch' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:80:inpre_process' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:55:in process' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:41:inreceive_data' eventmachine-1.0.3-x86 (mingw32) lib/eventmachine.rb:187:in run_machine' eventmachine-1.0.3-x86 (mingw32) lib/eventmachine.rb:187:inrun' thin-1.6.1-x86 (mingw32) lib/thin/backends/base.rb:73:in start' thin-1.6.1-x86 (mingw32) lib/thin/server.rb:162:instart' thin-1.6.1-x86 (mingw32) lib/thin/controllers/controller.rb:87:in start' thin-1.6.1-x86 (mingw32) lib/thin/runner.rb:200:inrun_command' thin-1.6.1-x86 (mingw32) lib/thin/runner.rb:156:in run!' thin-1.6.1-x86 (mingw32) bin/thin:6:in<top (required)>' bin/thin:16:in load' bin/thin:16:in

'

prmartinuk commented 9 years ago

Rails 4 removed the dynamic finder methods (like find_all_by_<name of property>) which previous versions of Rails used. Apparently you can get them working again if you add the activerecord-deprecated_finders gem, but as I haven't upgraded to Redmine 3 yet I can't say for definite it will work.

Rails 4 replaced the dynamic finder methods with query methods (e.g. KanbanStates.where( tracker_id: '5' ) ), so it the plugin will need to be updated to support both method styles at some point, but hopefully the activerecord-deprecated_finders gem will work for you in the meantime.

crick3t commented 9 years ago

Hi prmartinuk,

Thanks for your answer. We've tried it out and it started to work, or at least we do not have that error anymore. However now we have other issues.

When I create a new Kanban Stage the tool creates it, but the list shows rows with empty name and description.

Started POST "/redmine/kanban_stages" for 127.0.0.1 at 2015-04-07 17:24:50 +0100 Processing by KanbanStagesController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"K9K0d+fbCpyS79FWxLBwVw77DVqYHEMphCASg34R43LETm4wHZxrG7AJgeNM5BDyr5eDWyTsPSnbiN7pJUC29g==", "kanban_stage"=>{"name"=>"Test", "description"=>"Test"}, "commit"=>"Create"} Current user: admin (id=1) WARNING: Can't mass-assign protected attributes for KanbanStage: name, description

Rendered plugins/ekanban/app/views/kanban_stages/index.html.haml within layouts/base (9.0ms) Completed 200 OK in 391ms (Views: 206.0ms | ActiveRecord: 72.0ms) Started GET "/redmine/kanban_states/setup?tab=Stages" for 127.0.0.1 at 2015-04-07 17:24:51 +0100 Processing by KanbanStatesController#setup as HTML Parameters: {"tab"=>"Stages"} Current user: admin (id=1) DEPRECATION WARNING: This dynamic method is deprecated. Please use e.g. Post.where(...).all instead. (called from block in _plugins_ekanban_app_views_kanban_statesstate_list_htmlhaml418157488_50939028 at D:/Bitnami_Redmine/apps/redmine/htdocs/plugins/ekanban/app/views/kanban_states/_state_list.html.haml:6) DEPRECATION WARNING: This dynamic method is deprecated. Please use e.g. Post.where(...).all instead. (called from block in _plugins_ekanban_app_views_kanban_statesstate_list_htmlhaml418157488_50939028 at D:/Bitnami_Redmine/apps/redmine/htdocs/plugins/ekanban/app/views/kanban_states/_state_list.html.haml:6) DEPRECATION WARNING: This dynamic method is deprecated. Please use e.g. Post.where(...).all instead. (called from block in _plugins_ekanban_app_views_kanban_statesstate_list_htmlhaml418157488_50939028 at D:/Bitnami_Redmine/apps/redmine/htdocs/plugins/ekanban/app/views/kanban_states/_state_list.html.haml:6) DEPRECATION WARNING: This dynamic method is deprecated. Please use e.g. Post.where(...).all instead. (called from block in _plugins_ekanban_app_views_kanban_statesstate_list_htmlhaml418157488_50939028 at D:/Bitnami_Redmine/apps/redmine/htdocs/plugins/ekanban/app/views/kanban_states/_state_list.html.haml:6) DEPRECATION WARNING: This dynamic method is deprecated. Please use e.g. Post.where(...).all instead. (called from block in _plugins_ekanban_app_views_kanban_statesstate_list_htmlhaml418157488_50939028 at D:/Bitnami_Redmine/apps/redmine/htdocs/plugins/ekanban/app/views/kanban_states/_state_list.html.haml:6) Rendered plugins/ekanban/app/views/kanban_states/_state_list.html.haml (11.0ms) Rendered plugins/ekanban/app/views/kanban_states/_stage_list.html.haml (6.0ms) DEPRECATION WARNING: This dynamic method is deprecated. Please use e.g. Post.where(...).all instead. (called from _plugins_ekanban_app_views_kanban_statesmaps_form_html_haml492921406_31465992 at D:/Bitnami_Redmine/apps/redmine/htdocs/plugins/ekanban/app/views/kanban_states/_maps_form.html.haml:4) Rendered plugins/ekanban/app/views/kanban_states/_maps_form.html.haml (4.0ms) DEPRECATION WARNING: This dynamic method is deprecated. Please use e.g. Post.where(...).all instead. (called from _plugins_ekanban_app_views_kanban_statesmaps_form_html_haml492921406_31465992 at D:/Bitnami_Redmine/apps/redmine/htdocs/plugins/ekanban/app/views/kanban_states/_maps_form.html.haml:4) Rendered plugins/ekanban/app/views/kanban_states/_maps_form.html.haml (2.0ms) DEPRECATION WARNING: This dynamic method is deprecated. Please use e.g. Post.where(...).all instead. (called from _plugins_ekanban_app_views_kanban_statesmaps_form_html_haml492921406_31465992 at D:/Bitnami_Redmine/apps/redmine/htdocs/plugins/ekanban/app/views/kanban_states/_maps_form.html.haml:4) Rendered plugins/ekanban/app/views/kanban_states/_maps_form.html.haml (3.0ms) DEPRECATION WARNING: This dynamic method is deprecated. Please use e.g. Post.where(...).all instead. (called from _plugins_ekanban_app_views_kanban_statesmaps_form_html_haml492921406_31465992 at D:/Bitnami_Redmine/apps/redmine/htdocs/plugins/ekanban/app/views/kanban_states/_maps_form.html.haml:4) Rendered plugins/ekanban/app/views/kanban_states/_maps_form.html.haml (2.0ms) DEPRECATION WARNING: This dynamic method is deprecated. Please use e.g. Post.where(...).all instead. (called from _plugins_ekanban_app_views_kanban_states__maps_form_html_haml__492921406_31465992 at D:/Bitnami_Redmine/apps/redmine/htdocs/plugins/ekanban/app/views/kanban_states/_maps_form.html.haml:4) Rendered plugins/ekanban/app/views/kanban_states/_maps_form.html.haml (3.0ms) Rendered plugins/ekanban/app/views/kanban_states/_maps.html.haml (20.0ms) Rendered plugins/ekanban/app/views/common/_tabs.html.erb (40.0ms) Rendered plugins/ekanban/app/views/kanban_states/index.html.haml within layouts/base (40.0ms) Completed 200 OK in 61ms (Views: 52.0ms | ActiveRecord: 4.0ms)

After this when we try to create a Kanban State we receive the following internal error:

Started GET "/redmine/trackers/1/kanban_states/new" for 127.0.0.1 at 2015-04-07 17:28:02 +0100 Processing by KanbanStatesController#new as HTML Parameters: {"tracker_id"=>"1"} Current user: admin (id=1) Rendered plugins/ekanban/app/views/kanban_states/_form.html.haml (10.0ms) Rendered plugins/ekanban/app/views/kanban_states/new.html.haml within layouts/base (81.0ms) Completed 200 OK in 139ms (Views: 98.0ms | ActiveRecord: 9.0ms) Started POST "/redmine/trackers/1/kanban_states" for 127.0.0.1 at 2015-04-07 17:28:14 +0100 Processing by KanbanStatesController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"HKaHkMPbP86aIQd2x+UvLgRvaFCnOn6RXlQ+qDJWH33zOl3XOZxeSbjHV8NPsU+LpQPmURvKAJEB/PLCaQdK+Q==", "kanban_state"=>{"name"=>"Test State", "tracker_id"=>"1", "stage_id"=>"1", "is_default"=>"1", "is_initial"=>"1", "is_closed"=>"0", "description"=>""}, "commit"=>"Create", "tracker_id"=>"1"} Current user: admin (id=1) WARNING: Can't mass-assign protected attributes for KanbanState: name, tracker_id, stage_id, is_default, is_initial, is_closed, description

Rendered plugins/ekanban/app/views/kanban_states/_form.html.haml (6.0ms) Rendered plugins/ekanban/app/views/kanban_states/new.html.haml within layouts/base (10.0ms) Completed 500 Internal Server Error in 47ms

ActionView::Template::Error (undefined method id' for nil:NilClass): 1: = labelled_form_for :kanban_state, @state, :url => @state.id.nil? ? tracker_kanban_states_path(@tracker.id) : tracker_kanban_state_path(@tracker.id, @state.id), :html => {:id => 'kanban-state-form'} do |f| 2: .box.tabular 3: %p= f.text_field :name, :size => 30, :required => true 4: %p= f.select :tracker_id, options_from_collection_for_select(@trackers, "id", "name", @tracker.id), :label => l(:label_tracker), :required=>true plugins/ekanban/app/views/kanban_states/_form.html.haml:1:in_plugins_ekanban_app_views_kanban_statesform_html_haml___688133908_44342208' actionview (4.2.0) lib/action_view/template.rb:145:in block in render' activesupport (4.2.0) lib/active_support/notifications.rb:166:ininstrument' actionview (4.2.0) lib/action_view/template.rb:333:in instrument' actionview (4.2.0) lib/action_view/template.rb:143:inrender' actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:339:in render_partial' actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:310:inblock in render' actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:in block in instrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:inblock in instrument' activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:in instrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:ininstrument' actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:in instrument' actionview (4.2.0) lib/action_view/renderer/partial_renderer.rb:309:inrender' actionview (4.2.0) lib/action_view/renderer/renderer.rb:47:in render_partial' actionview (4.2.0) lib/action_view/renderer/renderer.rb:21:inrender' actionview (4.2.0) lib/action_view/helpers/rendering_helper.rb:32:in render' haml (4.0.6) lib/haml/helpers/action_view_mods.rb:10:inblock in render_with_haml' haml (4.0.6) lib/haml/helpers.rb:89:in non_haml' haml (4.0.6) lib/haml/helpers/action_view_mods.rb:10:inrender_with_haml' plugins/ekanban/app/views/kanban_states/new.html.haml:3:in `_plugins_ekanban_app_views_kanban_states_new_html_haml577768169_44010600' actionview (4.2.0) lib/action_view/template.rb:145:inblock in render' activesupport (4.2.0) lib/active_support/notifications.rb:166:ininstrument' actionview (4.2.0) lib/action_view/template.rb:333:ininstrument' actionview (4.2.0) lib/action_view/template.rb:143:inrender' actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:54:inblock (2 levels) in render_template' actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:inblock in instrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:inblock in instrument' activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:ininstrument' actionview (4.2.0) lib/action_view/renderer/abstract_renderer.rb:39:ininstrument' actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:53:inblock in render_template' actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:61:inrender_with_layout' actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:52:inrender_template' actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:14:inrender' actionview (4.2.0) lib/action_view/renderer/renderer.rb:42:inrender_template' actionview (4.2.0) lib/action_view/renderer/renderer.rb:23:inrender' actionview (4.2.0) lib/action_view/rendering.rb:100:in_render_template' actionpack (4.2.0) lib/action_controller/metal/streaming.rb:217:in_render_template' actionview (4.2.0) lib/action_view/rendering.rb:83:inrender_to_body' actionpack (4.2.0) lib/action_controller/metal/rendering.rb:32:inrender_to_body' actionpack (4.2.0) lib/action_controller/metal/renderers.rb:37:inrender_to_body' actionpack (4.2.0) lib/abstract_controller/rendering.rb:25:inrender' actionpack (4.2.0) lib/action_controller/metal/rendering.rb:16:inrender' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:41:inblock (2 levels) in render' activesupport (4.2.0) lib/active_support/core_ext/benchmark.rb:12:inblock in ms' D:/Bitnami_Redmine/ruby/lib/ruby/2.0.0/benchmark.rb:296:inrealtime' activesupport (4.2.0) lib/active_support/core_ext/benchmark.rb:12:inms' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:41:inblock in render' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:84:incleanup_view_runtime' activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:25:incleanup_view_runtime' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:40:inrender' plugins/ekanban/app/controllers/kanban_states_controller.rb:16:increate' actionpack (4.2.0) lib/action_controller/metal/implicit_render.rb:4:insend_action' actionpack (4.2.0) lib/abstract_controller/base.rb:198:inprocess_action' actionpack (4.2.0) lib/action_controller/metal/rendering.rb:10:inprocess_action' actionpack (4.2.0) lib/abstract_controller/callbacks.rb:20:inblock in process_action' activesupport (4.2.0) lib/active_support/callbacks.rb:117:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:117:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:234:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:234:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:92:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:92:in_run_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:734:in_run_process_action_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (4.2.0) lib/abstract_controller/callbacks.rb:19:inprocess_action' actionpack (4.2.0) lib/action_controller/metal/rescue.rb:29:inprocess_action' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:31:inblock in process_action' activesupport (4.2.0) lib/active_support/notifications.rb:164:inblock in instrument' activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:ininstrument' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:30:inprocess_action' actionpack (4.2.0) lib/action_controller/metal/params_wrapper.rb:250:inprocess_action' activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:18:inprocess_action' actionpack (4.2.0) lib/abstract_controller/base.rb:137:inprocess' actionview (4.2.0) lib/action_view/rendering.rb:30:inprocess' actionpack (4.2.0) lib/action_controller/metal.rb:195:indispatch' actionpack (4.2.0) lib/action_controller/metal/rack_delegation.rb:13:indispatch' actionpack (4.2.0) lib/action_controller/metal.rb:236:inblock in action' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:incall' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:indispatch' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:42:inserve' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:43:inblock in serve' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:ineach' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:inserve' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:802:incall' rack-openid (1.4.2) lib/rack/openid.rb:98:incall' request_store (1.0.5) lib/request_store/middleware.rb:9:incall' rack (1.6.0) lib/rack/etag.rb:24:incall' rack (1.6.0) lib/rack/conditionalget.rb:38:incall' rack (1.6.0) lib/rack/head.rb:13:incall' actionpack-xml_parser (1.0.1) lib/action_dispatch/xml_params_parser.rb:16:incall' actionpack (4.2.0) lib/action_dispatch/middleware/params_parser.rb:27:incall' actionpack (4.2.0) lib/action_dispatch/middleware/flash.rb:260:incall' rack (1.6.0) lib/rack/session/abstract/id.rb:225:incontext' rack (1.6.0) lib/rack/session/abstract/id.rb:220:incall' actionpack (4.2.0) lib/action_dispatch/middleware/cookies.rb:560:incall' activerecord (4.2.0) lib/active_record/query_cache.rb:36:incall' activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:647:incall' actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:inblock in call' activesupport (4.2.0) lib/active_support/callbacks.rb:88:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:88:in_run_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:734:in_run_call_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:incall' actionpack (4.2.0) lib/action_dispatch/middleware/remote_ip.rb:78:incall' actionpack (4.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:incall' actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:incall' railties (4.2.0) lib/rails/rack/logger.rb:38:incall_app' railties (4.2.0) lib/rails/rack/logger.rb:20:inblock in call' activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:inblock in tagged' activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:intagged' activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:intagged' railties (4.2.0) lib/rails/rack/logger.rb:20:incall' actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:incall' rack (1.6.0) lib/rack/methodoverride.rb:22:incall' rack (1.6.0) lib/rack/runtime.rb:18:incall' activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:incall' actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:incall' rack (1.6.0) lib/rack/sendfile.rb:113:incall' railties (4.2.0) lib/rails/engine.rb:518:incall' railties (4.2.0) lib/rails/application.rb:164:incall' railties (4.2.0) lib/rails/railtie.rb:194:inpublic_send' railties (4.2.0) lib/rails/railtie.rb:194:inmethod_missing' rack (1.6.0) lib/rack/urlmap.rb:66:inblock in call' rack (1.6.0) lib/rack/urlmap.rb:50:ineach' rack (1.6.0) lib/rack/urlmap.rb:50:incall' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:82:inblock in pre_process' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:80:incatch' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:80:inpre_process' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:55:inprocess' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:41:inreceive_data' eventmachine-1.0.3-x86 (mingw32) lib/eventmachine.rb:187:inrun_machine' eventmachine-1.0.3-x86 (mingw32) lib/eventmachine.rb:187:inrun' thin-1.6.1-x86 (mingw32) lib/thin/backends/base.rb:73:instart' thin-1.6.1-x86 (mingw32) lib/thin/server.rb:162:instart' thin-1.6.1-x86 (mingw32) lib/thin/controllers/controller.rb:87:instart' thin-1.6.1-x86 (mingw32) lib/thin/runner.rb:200:inrun_command' thin-1.6.1-x86 (mingw32) lib/thin/runner.rb:156:inrun!' thin-1.6.1-x86 (mingw32) bin/thin:6:in<top (required)>' bin/thin:16:inload' bin/thin:16:in

'

prmartinuk commented 9 years ago

I think the problem now might relate to the fact that Redmine 3.x added the gem protected_attributes to its Gemfile. Adding this gem allows developers to specify whether attributes are mass assignable (e.g. KanbanState.create( { :name => "Dev State" :tracker_id=> 1, :stage_id => 4 .... } ) ) or if they are protected and you have to assign them individually in code (e.g. state.name = "Dev State" ). This is to allow for improved security because it means the developer can protect certain attributes from being updated in certain ways..

In this case the security has stopped both the new Kanban State and the new Kanban Stage from having their attributes (name, tracker_id, etc) from being set, which is meaning they show blank and cause errors.

There is a application configuration parameter that says whether the developer has to say it is mass assignable or protected, or if everything is assumed to be mass assignable unless you tell it otherwise. As far as I can understand from the forums by default the configuration parameter is enabled which means that the plugin needs to add attr_accessible followed by the names of all the attributes to each of the models (e.g. attr_accessible :name, :tracker_id, ...).

As a quick fix I think you can just turn off application configuration parameter. To one of the initialising configuration files (I'd probably put it in <Redmine root>/config/application.rb) you can add the line: config.active_record.whitelist_attributes = false I still haven't upgraded to Redmine 3.x yet so as before can't say for definite it will work.

Interestingly protected_attributes is now a gem file because it has been dropped from the Ruby core and has been replaced by Strong Parameters, so things may change again in a future Redmine release.

crick3t commented 9 years ago

Hi prmartinuk,

thanks for the quick reply. We got a step forward, but it is still not working. The mass assign is working now, but when we go to the "Issue Status and Kanban States" tab we get the error below at save. I am not sure if we can make this work. For me it seems like they have deprecated the diff method without any replacement. We just get errors after errors, so I am not sure if it worth to play with it. Probably the best is if we wait until someone updates the project and makes it compatible with Redmine 3.

NoMethodError (undefined method diff' for {"1"=>["1", "2", "4"], "2"=>["5", "7", "9"]}:ActionController::Parameters): plugins/ekanban/app/controllers/issue_status_kanban_states_controller.rb:10:inupdate' actionpack (4.2.0) lib/action_controller/metal/implicit_render.rb:4:in send_action' actionpack (4.2.0) lib/abstract_controller/base.rb:198:inprocess_action' actionpack (4.2.0) lib/action_controller/metal/rendering.rb:10:in process_action' actionpack (4.2.0) lib/abstract_controller/callbacks.rb:20:inblock in process_action' activesupport (4.2.0) lib/active_support/callbacks.rb:117:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:117:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:234:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:234:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in block in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:92:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:92:in _run_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:734:in_run_process_action_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (4.2.0) lib/abstract_controller/callbacks.rb:19:inprocess_action' actionpack (4.2.0) lib/action_controller/metal/rescue.rb:29:in process_action' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:31:inblock in process_action' activesupport (4.2.0) lib/active_support/notifications.rb:164:in block in instrument' activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:in instrument' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:30:inprocess_action' actionpack (4.2.0) lib/action_controller/metal/params_wrapper.rb:250:in process_action' activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:18:inprocess_action' actionpack (4.2.0) lib/abstract_controller/base.rb:137:in process' actionview (4.2.0) lib/action_view/rendering.rb:30:inprocess' actionpack (4.2.0) lib/action_controller/metal.rb:195:in dispatch' actionpack (4.2.0) lib/action_controller/metal/rack_delegation.rb:13:indispatch' actionpack (4.2.0) lib/action_controller/metal.rb:236:in block in action' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:incall' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:in dispatch' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:42:inserve' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:43:in block in serve' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:ineach' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in serve' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:802:incall' rack-openid (1.4.2) lib/rack/openid.rb:98:in call' request_store (1.0.5) lib/request_store/middleware.rb:9:incall' rack (1.6.0) lib/rack/etag.rb:24:in call' rack (1.6.0) lib/rack/conditionalget.rb:38:incall' rack (1.6.0) lib/rack/head.rb:13:in call' actionpack-xml_parser (1.0.1) lib/action_dispatch/xml_params_parser.rb:16:incall' actionpack (4.2.0) lib/action_dispatch/middleware/params_parser.rb:27:in call' actionpack (4.2.0) lib/action_dispatch/middleware/flash.rb:260:incall' rack (1.6.0) lib/rack/session/abstract/id.rb:225:in context' rack (1.6.0) lib/rack/session/abstract/id.rb:220:incall' actionpack (4.2.0) lib/action_dispatch/middleware/cookies.rb:560:in call' activerecord (4.2.0) lib/active_record/query_cache.rb:36:incall' activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in call' actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:inblock in call' activesupport (4.2.0) lib/active_support/callbacks.rb:88:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:88:in_run_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:734:in _run_call_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (4.2.0) lib/action_dispatch/middleware/remote_ip.rb:78:incall' actionpack (4.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in call' actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:incall' railties (4.2.0) lib/rails/rack/logger.rb:38:in call_app' railties (4.2.0) lib/rails/rack/logger.rb:20:inblock in call' activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in block in tagged' activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:intagged' activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in tagged' railties (4.2.0) lib/rails/rack/logger.rb:20:incall' actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in call' rack (1.6.0) lib/rack/methodoverride.rb:22:incall' rack (1.6.0) lib/rack/runtime.rb:18:in call' activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:incall' actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in call' rack (1.6.0) lib/rack/sendfile.rb:113:incall' railties (4.2.0) lib/rails/engine.rb:518:in call' railties (4.2.0) lib/rails/application.rb:164:incall' railties (4.2.0) lib/rails/railtie.rb:194:in public_send' railties (4.2.0) lib/rails/railtie.rb:194:inmethod_missing' rack (1.6.0) lib/rack/urlmap.rb:66:in block in call' rack (1.6.0) lib/rack/urlmap.rb:50:ineach' rack (1.6.0) lib/rack/urlmap.rb:50:in call' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:82:inblock in pre_process' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:80:in catch' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:80:inpre_process' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:55:in process' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:41:inreceive_data' eventmachine-1.0.3-x86 (mingw32) lib/eventmachine.rb:187:in run_machine' eventmachine-1.0.3-x86 (mingw32) lib/eventmachine.rb:187:inrun' thin-1.6.1-x86 (mingw32) lib/thin/backends/base.rb:73:in start' thin-1.6.1-x86 (mingw32) lib/thin/server.rb:162:instart' thin-1.6.1-x86 (mingw32) lib/thin/controllers/controller.rb:87:in start' thin-1.6.1-x86 (mingw32) lib/thin/runner.rb:200:inrun_command' thin-1.6.1-x86 (mingw32) lib/thin/runner.rb:156:in run!' thin-1.6.1-x86 (mingw32) bin/thin:6:in<top (required)>' bin/thin:16:in load' bin/thin:16:in

'

prmartinuk commented 9 years ago

Unfortunately I'll probably have to join you on your conclusion that it might be best to just wait until the plugin is updated to support Redmine 3.x (or rather Rails 4.x which seems to be the main issue), we keep hitting Rails change after Rails change.

If you did want to fix the diff error then the code underlying the diff function can be found here: https://github.com/rails/rails/blob/4-0-stable/activesupport/lib/active_support/core_ext/hash/diff.rb The place which is giving you the error is the only place that uses the diff function so you could replace line 10 of ekanban/app/controllers/issue_status_kanban_states_controller.rb with something like:

diff = new_maps.dup.
    delete_if { |k, v| old_maps[k] == v }.
    merge!(old_maps.dup.delete_if { |k, v| has_key?(k) })
crick3t commented 9 years ago

We changed the code to your version. There was one missing variable before "has_key?(k)"

    diff = new_maps.dup.
        delete_if { |k, v| old_maps[k] == v }.
        merge!(old_maps.dup.delete_if { |k, v| old_maps.has_key?(k) })

After this it stopped crashing. But we still have issues like

We could live with that for now :) but then we got another error (see below). Anyway, I think we will give it up here. Thanks for your help.

Regards, Peter

Started GET "/redmine/trackers/1/kanban_states" for 127.0.0.1 at 2015-04-09 11:12:16 +0100 Processing by KanbanStatesController#index as HTML Parameters: {"tracker_id"=>"1"} Current user: admin (id=1) Completed 500 Internal Server Error in 5ms

NoMethodError (undefined method by_tracker' for #<Class:0x6028890>): activerecord (4.2.0) lib/active_record/dynamic_matchers.rb:26:inmethod_missing' plugins/ekanban/app/controllers/kanban_states_controller.rb:50:in index' actionpack (4.2.0) lib/action_controller/metal/implicit_render.rb:4:insend_action' actionpack (4.2.0) lib/abstract_controller/base.rb:198:in process_action' actionpack (4.2.0) lib/action_controller/metal/rendering.rb:10:inprocess_action' actionpack (4.2.0) lib/abstract_controller/callbacks.rb:20:in block in process_action' activesupport (4.2.0) lib/active_support/callbacks.rb:117:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:117:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:234:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:234:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:169:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:169:inblock in halting' activesupport (4.2.0) lib/active_support/callbacks.rb:92:in call' activesupport (4.2.0) lib/active_support/callbacks.rb:92:in_run_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:734:in _run_process_action_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (4.2.0) lib/abstract_controller/callbacks.rb:19:in process_action' actionpack (4.2.0) lib/action_controller/metal/rescue.rb:29:inprocess_action' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:31:in block in process_action' activesupport (4.2.0) lib/active_support/notifications.rb:164:inblock in instrument' activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:in instrument' activesupport (4.2.0) lib/active_support/notifications.rb:164:ininstrument' actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:30:in process_action' actionpack (4.2.0) lib/action_controller/metal/params_wrapper.rb:250:inprocess_action' activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:18:in process_action' actionpack (4.2.0) lib/abstract_controller/base.rb:137:inprocess' actionview (4.2.0) lib/action_view/rendering.rb:30:in process' actionpack (4.2.0) lib/action_controller/metal.rb:195:indispatch' actionpack (4.2.0) lib/action_controller/metal/rack_delegation.rb:13:in dispatch' actionpack (4.2.0) lib/action_controller/metal.rb:236:inblock in action' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:in call' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:indispatch' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:42:in serve' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:43:inblock in serve' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in each' actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:inserve' actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:802:in call' rack-openid (1.4.2) lib/rack/openid.rb:98:incall' request_store (1.0.5) lib/request_store/middleware.rb:9:in call' rack (1.6.0) lib/rack/etag.rb:24:incall' rack (1.6.0) lib/rack/conditionalget.rb:25:in call' rack (1.6.0) lib/rack/head.rb:13:incall' actionpack-xml_parser (1.0.1) lib/action_dispatch/xml_params_parser.rb:16:in call' actionpack (4.2.0) lib/action_dispatch/middleware/params_parser.rb:27:incall' actionpack (4.2.0) lib/action_dispatch/middleware/flash.rb:260:in call' rack (1.6.0) lib/rack/session/abstract/id.rb:225:incontext' rack (1.6.0) lib/rack/session/abstract/id.rb:220:in call' actionpack (4.2.0) lib/action_dispatch/middleware/cookies.rb:560:incall' activerecord (4.2.0) lib/active_record/query_cache.rb:36:in call' activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:647:incall' actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:in block in call' activesupport (4.2.0) lib/active_support/callbacks.rb:88:incall' activesupport (4.2.0) lib/active_support/callbacks.rb:88:in _run_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:734:in_run_call_callbacks' activesupport (4.2.0) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:incall' actionpack (4.2.0) lib/action_dispatch/middleware/remote_ip.rb:78:in call' actionpack (4.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:incall' actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in call' railties (4.2.0) lib/rails/rack/logger.rb:38:incall_app' railties (4.2.0) lib/rails/rack/logger.rb:20:in block in call' activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:inblock in tagged' activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:in tagged' activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:intagged' railties (4.2.0) lib/rails/rack/logger.rb:20:in call' actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:incall' rack (1.6.0) lib/rack/methodoverride.rb:22:in call' rack (1.6.0) lib/rack/runtime.rb:18:incall' activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in call' actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:incall' rack (1.6.0) lib/rack/sendfile.rb:113:in call' railties (4.2.0) lib/rails/engine.rb:518:incall' railties (4.2.0) lib/rails/application.rb:164:in call' railties (4.2.0) lib/rails/railtie.rb:194:inpublic_send' railties (4.2.0) lib/rails/railtie.rb:194:in method_missing' rack (1.6.0) lib/rack/urlmap.rb:66:inblock in call' rack (1.6.0) lib/rack/urlmap.rb:50:in each' rack (1.6.0) lib/rack/urlmap.rb:50:incall' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:82:in block in pre_process' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:80:incatch' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:80:in pre_process' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:55:inprocess' thin-1.6.1-x86 (mingw32) lib/thin/connection.rb:41:in receive_data' eventmachine-1.0.3-x86 (mingw32) lib/eventmachine.rb:187:inrun_machine' eventmachine-1.0.3-x86 (mingw32) lib/eventmachine.rb:187:in run' thin-1.6.1-x86 (mingw32) lib/thin/backends/base.rb:73:instart' thin-1.6.1-x86 (mingw32) lib/thin/server.rb:162:in start' thin-1.6.1-x86 (mingw32) lib/thin/controllers/controller.rb:87:instart' thin-1.6.1-x86 (mingw32) lib/thin/runner.rb:200:in run_command' thin-1.6.1-x86 (mingw32) lib/thin/runner.rb:156:inrun!' thin-1.6.1-x86 (mingw32) bin/thin:6:in <top (required)>' bin/thin:16:inload' bin/thin:16:in `

'

luizduma commented 9 years ago

Hi crick3t

I think that correct change is

diff = new_maps.dup.
  delete_if { |k, v| old_maps[k] == v }.
  merge!(old_maps.dup.delete_if { |k, v| new_maps.has_key?(k) })
luizduma commented 9 years ago

I made some modifications in ekanban plugin in order to work with redmine 3.0.3.

I have little knowledge in ruby/rails and probably I made some mistakes but now the plugin is working better in my environment but with some errors yet.

I´m using ruby 2.1.2p95, Rails 4.2.1 and Redmine 3.0.3 and If you like, take a look in the diff file at

https://gist.github.com/luizduma/ee11352a8c52ef22f70c

luizduma commented 9 years ago

A new diff revision is available at https://gist.github.com/luizduma/ee11352a8c52ef22f70c

I made more changes using the tool arel_converter

Now, I got "Internal error" when trying to list the kanbans (http://my_server/projects/test1/kanbans)

redmine log

Started GET "/projects/test1/kanbans" for 10.0.0.100 at 2015-06-08 02:08:41 +0000 Processing by KanbansController#index as HTML Parameters: {"project_id"=>"test1"} Current user: xxx.yyy (id=5) Rendered plugins/ekanban/app/views/kanbans/index.html.haml within layouts/base (16.6ms) Completed 500 Internal Server Error in 38ms (ActiveRecord: 4.6ms)

ActionView::Template::Error (undefined method by_user' for #<Proc:0xb3fe52c8>): 1: .contextual 2: %span Your current wip: 3: = link_to "#{User.current.wip} ", my_page_path(), :id => "my-wip" 4: %span Limit: 5: = link_to "#{User.current.wip_limit} ", edit_user_path(User.current.id), :id => "my-wip-limit" 6: = link_to l(:label_kanban_new), new_project_kanban_path(@project.id), :class => 'icon icon-add' plugins/ekanban/lib/ekanban/user_patch.rb:32:inwip' plugins/ekanban/app/views/kanbans/index.html.haml:3:in _plugins_ekanban_app_views_kanbans_index_html_haml__976552863__639472298' actionview (4.2.1) lib/action_view/template.rb:145:inblock in render' activesupport (4.2.1) lib/active_support/notifications.rb:166:in `instrument'

douglas commented 9 years ago

Hello,

Do someone have ekanban running in Redmine 3.1 ? I saw some attempts here to make it happen and I would like to happen - just want to be sure to not waste time =)

douglas commented 9 years ago

This seems to be where the problem is:

https://github.com/samchen2009/ekanban/blob/de5d026533790afae04e6efebbb32cd4dbf812de/lib/ekanban/user_patch.rb#L32

Do anyone have any idea ?

SteveDavis commented 9 years ago

Hi - I just wondered if there's any further progress on anyone managing to get this fully functional with Redmine 3.1.x (with Rails 4)

We're looking to upgrade Redmine from 2.3.2 to 3.1.1, and at the moment eKanban is a blocker on us upgrading.

douglas commented 9 years ago

Hello @SteveDavis !

I guess nothing happened... I trying to make it work (I'm not a rails dev, but trying to fix things) - Could any rails dev here could help us make this happen ?

I'm trying to get some help from the local Ruby on Rails community but still no luck =(

Thanks !

SteveDavis commented 9 years ago

We're having a rethink on this - may well have to go with a lower level of redmine in order to keep current functionality. Thanks for getting back on this sop promptly though!