Project

General

Profile

Defect #1122

Error al abrir estedisticas de Scrum en la pagina principal

Added by Nicolas Arenas over 8 years ago.

Status:
New
Priority:
Normal
Category:
-
Target version:
-
Source:
Development
Detected on version:
Blocked:
No
Alone:
Milestones:
Sprint:

Description

Al intentar abrir la página de estadisticas de scrum en la página principal de un proyecto obtenemos un error 500.

En el log tenemos esta salida:


Started GET "/projects/qindel-qvd/scrum/stats" for 172.26.8.101 at 2015-10-23 14:40:35 +0200
Processing by ScrumController#stats as HTML
  Parameters: {"project_id"=>"qindel-qvd"}
  Current user: narenas (id=39)
Completed 500 Internal Server Error in 23ms (ActiveRecord: 2.6ms)

NoMethodError (undefined method `allowed_to_view_all_time_entries?' for #<User:0x007f994ede8340>):
  vendor/bundle/ruby/2.2.0/gems/activemodel-4.2.3/lib/active_model/attribute_methods.rb:433:in `method_missing'
  plugins/scrum/app/controllers/scrum_controller.rb:301:in `stats'
  vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/abstract_controller/base.rb:198:in `process_action'
  vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/rendering.rb:10:in `process_action'
  vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:115:in `call'
  vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:115:in `call'
  vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:553:in `block (2 levels) in compile'

Parece que allowed_to_view_all_time_entries no está definida.

La versión de ruby que usamos es : ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
Versión de rails : Rails 4.2.3

Parece que con este pequeño parche se soluciona, pero no soy desarrollador de Ruby, así que no tengo muy claro si puede afectar a algo más.

--- scrum_controller.rb.orig    2015-10-23 14:52:06.404252135 +0200
+++ scrum_controller.rb    2015-10-23 14:48:04.300252135 +0200
@@ -298,7 +298,7 @@ class ScrumController < ApplicationContr
   end

   def stats
-    if User.current.allowed_to_view_all_time_entries?(@project)
+    if defined?User.current.allowed_to_view_all_time_entries?(@project)
       cond = @project.project_condition(Setting.display_subprojects_issues?)
       @total_hours = TimeEntry.visible.where(cond).sum(:hours).to_f
     end

Saludos y gracias por el esfuerzo.

No data to display

Also available in: Atom PDF