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

500 error when trying to start a timer (Nothing Happens) #65

Open
nano-cube opened this issue Mar 2, 2020 · 2 comments
Open

500 error when trying to start a timer (Nothing Happens) #65

nano-cube opened this issue Mar 2, 2020 · 2 comments

Comments

@nano-cube
Copy link

Similar to issue #33, but I am using the default theme.

I don't have exactly the permission Log Time, but I do have Log spent time, is that the same?
image

I click to start the timer:
image

Nothing happens, but this is the error I get in chrome JavaScript Console (when I try to start a timer):

jquery-2.2.4-ui-1.11.0-ujs-5.2.3.js?1576844386:24 
GET https://www.example.com/redmine/time_loggers/start?issue_id=2 500
  S.ajax @ jquery-2.2.4-ui-1.11.0-ujs-5.2.3.js?1576844386:24
  S.handleRemote @ jquery-2.2.4-ui-1.11.0-ujs-5.2.3.js?1576844386:24
  (anonymous) @ jquery-2.2.4-ui-1.11.0-ujs-5.2.3.js?1576844386:24

Admin Information:

Environment:
  Redmine version                4.1.0.stable
  Ruby version                   2.6.5-p114 (2019-10-01) [x86_64-linux]
  Rails version                  5.2.4.1
  Environment                    production
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                sendmail
SCM:
  Git                            2.17.1
  Filesystem                     
Redmine plugins:
  periodictask                   4.1.0
  redmine_checklists             3.1.16
  redmine_indicator              0.2.10
  redmine_issue_dynamic_edit     0.6.9
  redmine_work_time              0.4.0
  time_logger                    0.5.4
@Luckyvb
Copy link

Luckyvb commented Jan 9, 2021

Completed 500 Internal Server Error in 8ms (ActiveRecord: 1.7ms)
ArgumentError (wrong number of arguments (given 2, expected 0..1)):
plugins/time_logger/app/models/time_logger.rb:15:in `initialize'
plugins/time_logger/app/controllers/time_loggers_controller.rb:18:in `start'

@Luckyvb
Copy link

Luckyvb commented Jan 9, 2021

diff --git a/app/models/time_logger.rb b/app/models/time_logger.rb
index e50b01b..f2863d8 100644
--- a/app/models/time_logger.rb
+++ b/app/models/time_logger.rb
@@ -12,8 +12,9 @@ class TimeLogger < ActiveRecord::Base
belongs_to :user
has_one :issue

  • def initialize(arguments = nil)
  • super(arguments)
  • def initialize(attributes = nil, options = {})
  • super(attributes, options)
    self.user_id = User.current.id
    self.started_on = DateTime.now
    self.time_spent = 0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant