Patch #9118
rack 1.3.1 "cookies.delete :autologin" raise NoMethodError on Symbol
| Status: | Closed | Start date: | 2011-08-24 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% | |
| Category: | Rails support | |||
| Target version: | - |
Description
Running redmine 1.1.3 or 1.2.1 with rack 1.3.1, i get on logout :
NoMethodError in AccountController#logout private method `gsub' called for :autologin:Symbol RAILS_ROOT: /usr/share/redmine Application Trace | Framework Trace | Full Trace /usr/lib/ruby/vendor_ruby/rack/backports/uri/common.rb:24:in `encode_www_form_component' /usr/lib/ruby/vendor_ruby/rack/utils.rb:23:in `escape' /usr/lib/ruby/vendor_ruby/rack/utils.rb:201:in `set_cookie_header!' /usr/lib/ruby/vendor_ruby/rack/utils.rb:238:in `delete_cookie_header!' /usr/lib/ruby/vendor_ruby/rack/response.rb:63:in `delete_cookie' /usr/lib/ruby/vendor_ruby/action_controller/cookies.rb:94:in `delete' /usr/share/redmine/app/controllers/account_controller.rb:132:in `logout_user' /usr/share/redmine/app/controllers/account_controller.rb:36:in `logout'
A simple way to fix this is :
--- app/controllers/account_controller.rb.orig 2011-08-24 11:41:33.000000000 -0300
+++ app/controllers/account_controller.rb 2011-08-24 09:21:00.000000000 -0300
@@ -129,7 +129,7 @@
def logout_user
if User.current.logged?
- cookies.delete :autologin
+ cookies.delete :autologin.to_s
Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
self.logged_user = nil
end
Related issues
History
#1 Updated by Marc Dequènes almost 2 years ago
I encountered this issue and this patch fixed it.
#2 Updated by Derek Chen-Becker almost 2 years ago
I have the same issue. Patch fixed it
#3 Updated by Jérémy Lal almost 2 years ago
- File 1013_cookie_symbol_to_s.patch
added
A more complete patch here.
#4 Updated by Etienne Massip over 1 year ago
#5 Updated by Etienne Massip over 1 year ago
- Status changed from New to Closed
Should have been fixed with Rack v1.4.0, released on December, 28.