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

Users with view_others_spent_time permission gets Error 500 #78

Open
xJom opened this issue Oct 16, 2015 · 4 comments
Open

Users with view_others_spent_time permission gets Error 500 #78

xJom opened this issue Oct 16, 2015 · 4 comments
Labels

Comments

@xJom
Copy link

xJom commented Oct 16, 2015

Using Redmine 3.0.4, and Spent time plugin version 3.1.2, I get the following error:
undefined method `order' for #Array:0x007f4694c18950
when a user with permission to "view others spent time" tries to access the Spent Time from menu.

The trace log:

/gitRepos/redmine/redmine-3.0.4/plugins/redmine_spent_time/app/controllers/spent_time_controller.rb:25:in `index'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/abstract_controller/base.rb:198:in `process_action'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_controller/metal/rendering.rb:10:in `process_action'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:115:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:115:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:553:in `block (2 levels) in compile'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:503:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:503:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:88:in `run_callbacks'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/abstract_controller/callbacks.rb:19:in `process_action'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_controller/metal/rescue.rb:29:in `process_action'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/notifications.rb:164:in `block in instrument'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/notifications.rb:164:in `instrument'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/usr/lib64/ruby/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/abstract_controller/base.rb:137:in `process'
/usr/lib64/ruby/gems/2.1.0/gems/actionview-4.2.3/lib/action_view/rendering.rb:30:in `process'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_controller/metal.rb:196:in `dispatch'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_controller/metal.rb:237:in `block in action'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:76:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:45:in `serve'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/journey/router.rb:30:in `each'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/journey/router.rb:30:in `serve'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:821:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/rack-openid-1.4.2/lib/rack/openid.rb:98:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/request_store-1.0.5/lib/request_store/middleware.rb:9:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/etag.rb:24:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/conditionalget.rb:25:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-xml_parser-1.0.2/lib/action_dispatch/xml_params_parser.rb:16:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/gitRepos/redmine/redmine-3.0.4/plugins/redmine_dmsf/lib/redmine_dmsf/webdav/no_parse.rb:33:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/flash.rb:260:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
/usr/lib64/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/query_cache.rb:36:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:84:in `run_callbacks'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/railties-4.2.3/lib/rails/rack/logger.rb:38:in `call_app'
/usr/lib64/ruby/gems/2.1.0/gems/railties-4.2.3/lib/rails/rack/logger.rb:20:in `block in call'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/tagged_logging.rb:26:in `tagged'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/tagged_logging.rb:68:in `tagged'
/usr/lib64/ruby/gems/2.1.0/gems/railties-4.2.3/lib/rails/rack/logger.rb:20:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/static.rb:116:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/railties-4.2.3/lib/rails/engine.rb:518:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/railties-4.2.3/lib/rails/application.rb:165:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/lock.rb:17:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:88:in `service'
/usr/lib64/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
/usr/lib64/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
/usr/lib64/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'

The closest I get from searching an answer to this is: http://stackoverflow.com/questions/15730432/order-array-undefined-method-order-for-array-convert-array-into-hash

Would it help to change the order on line 25 into the suggested solution in that thread?

@aszollosi
Copy link

Hi
We just upgraded our Redmine version and after the upgrade we have the same issue.

Did changing the order of the lines help?

@xJom
Copy link
Author

xJom commented Feb 1, 2016

I didn't try it. I took the easy way out and gave the users the higher order of permission "View every project spent time".

@vol4iniche
Copy link

The same problem as aszollosi .
after the upgrade we have error 500

@eyp eyp added the bug label Apr 8, 2016
@krisjaniz
Copy link
Contributor

Quick fix:
Replace app/controllers/spent_time_controller.rb line 25:
@users.order(:firstname)
@users.sort!

krisjaniz added a commit to krisjaniz/redmine_spent_time that referenced this issue Sep 23, 2016
Changed the line in spent_time_controller.rb that was giving the error:
undefined method `order' for #Array:0x007f4694c18950
when a user with permission to "view others spent time" tries to access
the Spent Time from menu.
eyp added a commit that referenced this issue Aug 5, 2017
Fix for bug #78 undefined method `order' for #Array:0x007f4694c18950
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants