eyp / redmine_spent_time

Redmine plugin that improves the spent time functionality.
Other
57 stars 39 forks source link

Spent_time 3.1.2 error 500 for non-manager users #113

Closed lifeboy closed 5 years ago

lifeboy commented 6 years ago

When a non-manager user clicks the "spend time" menu item, the following error is recorded in the production log:

Started GET "/spent_time" for 192.168.120.225 at 2018-06-05 08:25:42 +0000
Processing by SpentTimeController#index as HTML
  Current user: pablice (id=7)
Completed 500 Internal Server Error in 231ms (ActiveRecord: 123.8ms)

NoMethodError (undefined method `order' for #<Array:0x00559c5c8fec30>):
  plugins/redmine_spent_time/app/controllers/spent_time_controller.rb:25:in `index'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Environment:
  Redmine version                3.2.6.stable
  Ruby version                   2.3.3-p222 (2016-11-21) [x86_64-linux]
  Rails version                  4.2.7.1
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.10
  Mercurial                      3.1.2
  Bazaar                         2.7.0
  Git                            2.1.4
  Filesystem                     
Redmine plugins:
  clipboard_image_paste          1.12
  redmine_agile                  1.4.5
  redmine_app__space             1.0.4
  redmine_checklists             3.1.10
  redmine_spent_time             3.1.2

How do I fix this please?

lifeboy commented 6 years ago

How are others using the plugin? Are your non-manager users able to use the "spent time" plugin?

lifeboy commented 6 years ago

Sort of solved! It turns out that "View every project spent time" must be enabled for the "Time Spent" plugin to work for a user. This is a problem however, since developers for example should not necessarily be able to see all projects' time spent.

Can this be addressed please?

eyp commented 6 years ago

For sure it's a bug, I'll try to have a look at it in order to solve it. Thank you for the feedback.

On Fri, Jun 8, 2018, 13:01 Roland Giesler notifications@github.com wrote:

Sort of solved! It turns out that "View every project spent time" must be enabled for the "Time Spent" plugin to work for a user. This is a problem however, since developers for example should not necessarily be able to see all projects' time spent.

Can this be addressed please?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/eyp/redmine_spent_time/issues/113#issuecomment-395727268, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCfBlR48piHwbyAKAYPaUkMn09ROWWxks5t6lmagaJpZM4UaXh- .

eyp commented 5 years ago

Cannot reproduce in Redmine 4.0.4. I've tried with several users with different permissions, never get this error.