Hi All,
I stumbled upon this bug, when i was trying to write my own sidebar plugin.
Whenever i try to add or remove items to sidebar by dragging the stuff to
the active region, i get error:
NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.reject):
/app/controllers/admin/sidebar_controller.rb:48:in `remove'
/vendor/rails/actionpack/lib/action_controller/base.rb:910:in
`perform_action_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:368:in
`perform_action_without_benchmark'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
/vendor/rails/actionpack/lib/action_controller/rescue.rb:82:in
`perform_action'
/vendor/rails/actionpack/lib/action_controller/base.rb:381:in
`process_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:377:in
`process_without_session_management_support'
/vendor/rails/actionpack/lib/action_controller/session_management.rb:117:in
`process'
/vendor/rails/railties/lib/dispatcher.rb:38:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/rails.rb:73:in
`process'
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:551:in
`process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:550:in
`process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:636:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:636:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:625:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:956:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:955:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:127:in
`run'
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/command.rb:199:in
`run'
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:235
/usr/bin/mongrel_rails:18
[4;35;1mUser Columns (0.001528) [0m [0mSHOW FIELDS FROM users [0m
Rendering
/home/hemant/public_html/analyst_blog/config/../vendor/rails/actionpack/lib/
action_controller/templates/rescues/layout.rhtml (500 Internal Error)
And the problem is with the line:
activemap = flash[:sidebars].inject({}) do |h, sb_id|
sb = Sidebar.find(sb_id.to_i)
sb ? h.merge({ sb.html_id => sb_id }) : h
end
while we assign the active plugins to flash[:sidebars] in index action, but
they are replaced or lost in set_active method and hence the bug.
It may be something to do with the way mongrel handles sessions alos, but
may be.
It looks a bug to me, right now.
_______________________________________________
Typo-list mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/typo-list