speedy32129 / time_logger

Redmine Time logger plugin. More than likely there is only going to be one more public release. New version has new time logging with the option of multiple loggers running at the same time, fixes for excessive loggng, and a whole new look.
Other
59 stars 43 forks source link

undefined method `time_logger_for' #1

Closed ppoektos closed 10 years ago

ppoektos commented 10 years ago
  Rendered plugins/time_logger/app/views/time_loggers/_embed_menu.html.erb (236.9ms)
  Rendered plugins/time_logger/app/views/time_loggers/_update_menu.html.erb (237.2ms)
Completed 500 Internal Server Error in 437.0ms

ActionView::Template::Error (undefined method `time_logger_for' for #<#<Class:0xbe34800>:0xbe32014>):
    1: <%# time_logger = nil %>
    2: <% time_logger = time_logger_for(User.current) %>
    3: <% if !time_logger.nil? %>
    4:     <% if time_logger.paused %>
    5:         <%# A time tracker is in pause, display the tracked issue, the time spent and the resume/stop actions %>
  lib/redmine/hook.rb:111:in `block in render_on'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:158:in `call_hook'
  app/views/layouts/base.html.erb:75:in `_app_views_layouts_base_html_erb__595451985_86844930'

Environment:
  Redmine version                2.4.0.stable
  Ruby version                   1.9.3-p327 (2012-11-10) [i686-linux]
  Rails version                  3.2.15
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.8
  Git                            1.7.1
  Filesystem                     
Redmine plugins:
  multi_time_tracker             0.1.1
  projects_table                 0.0.4
  redmine_agile                  1.3.2
  redmine_better_gantt_chart     0.9.0
  redmine_dashboard              2.2.2
  redmine_drafts                 0.2.0
  redmine_equipment_status_viewer 1.0.1
  redmine_fields_permissions     1.0.0
  redmine_hide_estimated_hours   1.0.4
  redmine_issues_sidebar_time_entries_links 0.0.1
  redmine_knowledgebase          3.0.4
  redmine_lightbox               0.0.1
  redmine_monitoring_controlling 0.1.1
  redmine_planning               0.6.6
  redmine_plugin_views_revisions 0.0.1
  redmine_re                     development version
  redmine_timesheet_plugin       0.7.0
  redmine_xls_export             0.2.1.t4
  reklama                        0.2.1
  time_logger                    0.5.0
astebert commented 10 years ago

Same problem in redmine 2.5.x for /admin, /my/page, /home etc. It works only for issues/..

The error log : Started GET "/admin/" for 10.19.68.101 at 2014-07-22 17:54:22 +0200 Processing by AdminController#index as HTML Current user: bertrand (id=3) Rendered admin/_menu.html.erb (3.8ms) Rendered admin/index.html.erb within layouts/admin (7.0ms) Rendered plugins/time_logger/app/views/time_loggers/_embed_menu.html.erb (144.5ms) Rendered plugins/time_logger/app/views/time_loggers/_update_menu.html.erb (144.9ms) Rendered layouts/base.html.erb (159.1ms) Completed 500 Internal Server Error in 175.9ms

ActionView::Template::Error (undefined method time_logger_for' for #<#<Class:0x007f263e718610>:0x007f263e7215a8>): 1: <%# time_logger = nil %> 2: <% time_logger = time_logger_for(User.current) %> 3: <% if !time_logger.nil? %> 4: <% if time_logger.paused %> 5: <%# A time tracker is in pause, display the tracked issue, the time spent and the resume/stop actions %> lib/redmine/hook.rb:111:inblock in render_on' lib/redmine/hook.rb:61:in block (2 levels) in call_hook' lib/redmine/hook.rb:61:ineach' lib/redmine/hook.rb:61:in block in call_hook' lib/redmine/hook.rb:58:intap' lib/redmine/hook.rb:58:in call_hook' lib/redmine/hook.rb:158:incall_hook' app/views/layouts/base.html.erb:75:in _app_views_layouts_base_html_erb__3267297504538431705_69901116728820' app/views/layouts/admin.html.erb:8:in_app_views_layouts_admin_html_erb___1046586161394788776_69901116828420'

speedy32129 commented 10 years ago

Yes, I see that. see http://www.redmine.org/boards/3/topics/37345 I'm looking for a work around.

speedy32129 commented 10 years ago

I just tested on 2.5.2 an it worked. What specific version are you using? I'll test on 2.4 as above and let you know of the results.

Environment: Redmine version 2.5.2.stable Ruby version 1.9.3-p194 (2012-04-20) [x86_64-linux] Rails version 3.2.19 Environment production Database adapter Mysql2 SCM: Subversion 1.6.17 Mercurial 2.2.2 Bazaar 2.6.0 Git 1.7.10.4 Filesystem
Redmine plugins: time_logger 0.5.0

astebert commented 10 years ago

I have find the problem : Your plugin stop working when i install https://github.com/cole/redmine_ics_export And i want to use them both. If it can help improve your plugin.

astebert commented 10 years ago

Your plugin block many other extensions with the same error : Started GET "/time_loggers/rendermenu?=1406566907534" for 78.245.188.122 at 2014-07-28 19:01:46 +0200 Processing by TimeLoggersController#rendermenu as / Parameters: {""=>"1406566907534"} Current user: mathieu (id=4) Rendered plugins/time_logger/app/views/time_loggers/_embed_menu.html.erb (14.2ms) Completed 500 Internal Server Error in 17.3ms

ActionView::Template::Error (undefined method time_logger_for' for #<#<Class:0x007f874366cdb8>:0x007f874288f8a8>): 1: <%# time_logger = nil %> 2: <% time_logger = time_logger_for(User.current) %> 3: <% if !time_logger.nil? %> 4: <% if time_logger.paused %> 5: <%# A time tracker is in pause, display the tracked issue, the time spent and the resume/stop actions %> plugins/time_logger/app/views/time_loggers/_embed_menu.html.erb:2:in_plugins_time_logger_app_views_time_loggers__embed_menu_html_erb__926006374737522094_70109464108440' actionpack (3.2.19) lib/action_view/template.rb:145:in `block in render'

Your plugin is very usefull for me, but i can't figure that my redmine installation will work with only yours. Thanks.

jsmitka commented 10 years ago

I'm experiencing the same issue with the redmine_git_hosting plugin. When both plugins are enabled, the following error occurs on almost any page (except /issues):

Started GET "/" for 192.168.85.1 at 2014-08-14 13:10:45 +0200
Processing by WelcomeController#index as HTML
  Current user: admin (id=1)
  Rendered welcome/index.html.erb within layouts/base (30.7ms)
  Rendered plugins/time_logger/app/views/time_loggers/_embed_menu.html.erb (117.6ms)
  Rendered plugins/time_logger/app/views/time_loggers/_update_menu.html.erb (117.9ms)
Completed 500 Internal Server Error in 191.8ms

ActionView::Template::Error (undefined method `time_logger_for' for #<#<Class:0x000000085cb590>:0x000000085c99c0>):
    1: <%# time_logger = nil %>
    2: <% time_logger = time_logger_for(User.current) %>
    3: <% if !time_logger.nil? %>
    4:     <% if time_logger.paused %>
    5:         <%# A time tracker is in pause, display the tracked issue, the time spent and the resume/stop actions %>
  lib/redmine/hook.rb:111:in `block in render_on'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:158:in `call_hook'
  app/views/layouts/base.html.erb:75:in `_app_views_layouts_base_html_erb___4374229224082480152_70688140'

I'm testing the plugin on a relatively clean instance of redmine:

Environment:
  Redmine version                2.5.1.stable
  Ruby version                   2.0.0-p481 (2014-05-08) [x86_64-linux]
  Rails version                  3.2.17
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.6.11
  Git                            1.7.1
  Filesystem                     
Redmine plugins:
  redmine_bootstrap_kit          0.1
  redmine_git_hosting            0.7.3
  redmine_sidekiq                2.0.0
  redmine_zenedit                0.0.2

The error remains even after upgrading to Redmine 2.5.2 with the same plugins.

speedy32129 commented 10 years ago

For those that are having the issue. I think there is a simple fix. Please edit the init.rb and change the line

require 'redmine'

to

require 'redmine'

then rerun plugin migration

rake redmine:plugins:migrate RAILS_ENV=production

service apache2 restart

Let me know if this works and I'll create a new version.

jsmitka commented 10 years ago

I'm still getting the same error. I've commented out the require, uninstalled the plugin from database and recreated it, but it did not helped. Still the same issue.

I'm using the master branch from the git repo, should I try working-redmine-1.x?

speedy32129 commented 10 years ago

No. Your post said you are using Redmine version 2.5.1 that one is for Redmine 1.x. Once I get this bug out of 2.X I will be merging the 2 version for one install for 1.x to 2.5 once I get some java help.

jsmitka commented 10 years ago

Would a virtualbox machine with the preconfigured Redmine with this error help you? Unfortunately, I'm not a ruby guy, so I'm not able to figure out what's wrong.

RazZziel commented 10 years ago

I'm facing the same error, and commenting out require 'redmine' didn't help

I'm using the branch 2.5-stable from Redmine's hg, and have these plugin installed

clipboard_image_paste
redmine_contacts
redmine_contacts_invoices
redmine_embedded_video
redmine_inline_note_images_plugin
redmine_issue_checklist
redmine_ldap_sync
redmine_lightbox
redmine_people
jsmitka commented 10 years ago

I looked at the more mature (but more complex and less user-friendly) version of the plugin at hicknhack-software/redmine_time_tracker and it uses different approach to adding methods to ApplicationHelper. I tried to fix the plugin in jsmitka/time_logger@08f3ff51ef92c45132d615bfa6c50cac5dfedefc and it seems to be working.

@RazZziel, @astebert, @ppoektos, @speedy32129 could you please try the fixed version of this plugin? If it works for you, I will be happy to send a pull-request.

RazZziel commented 10 years ago

Seems to work beautifully, thanks!

speedy32129 commented 10 years ago

Yes please send me the pull request. I'm still learn ruby and githuib and I definitively want to give you credit. I actually was working on doing exactly what you did.

Once I get and figure out the pull request I'll tag a new version.

Once again thanks.