dhanasingh / redmine_wktime

ERPmine is an open source free ERP for Service Industries. It runs within Redmine
https://erpmine.org/
Other
121 stars 78 forks source link

Internal error 500 when exporting spent time to csv #315

Closed Q1984 closed 2 months ago

Q1984 commented 2 months ago

Hello,

Can you please check the plugin it causes internal server error when saving spent time to csv.

With the following errors:

I, [2024-07-10T10:19:50.362348 #2643223]  INFO -- : [85a24b02-5752-463c-9181-e11d4caa6733] Started GET "/time_entries.csv?utf8=%E2%9C%93&set_filter=1&f%5B%5D=spent_on&op%5Bspent_on%5D=*&c%5B%5D=project&c%5B%5D=spent_on&c%5B%5D=user&c%5B>
I, [2024-07-10T10:19:50.363359 #2643223]  INFO -- : [85a24b02-5752-463c-9181-e11d4caa6733] Processing by TimelogController#index as CSV
I, [2024-07-10T10:19:50.363427 #2643223]  INFO -- : [85a24b02-5752-463c-9181-e11d4caa6733]   Parameters: {"utf8"=>"✓", "set_filter"=>"1", "f"=>["spent_on"], "op"=>{"spent_on"=>"*"}, "c"=>["project", "spent_on", "user", "activity", "comm>
I, [2024-07-10T10:19:50.366914 #2643223]  INFO -- : [85a24b02-5752-463c-9181-e11d4caa6733]   Current user: admin (id=1)
I, [2024-07-10T10:19:57.093317 #2643223]  INFO -- : [85a24b02-5752-463c-9181-e11d4caa6733] Completed 500 Internal Server Error in 6730ms (ActiveRecord: 184.8ms | Allocations: 5110676)
F, [2024-07-10T10:19:57.095895 #2643223] FATAL -- : [85a24b02-5752-463c-9181-e11d4caa6733]
[85a24b02-5752-463c-9181-e11d4caa6733] NoMethodError (undefined method `filename_for_export' for #<TimelogController:0x000000001aa4c8>

                                        send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => "#{filename_for_export(@query, 'timelog')}.csv")
                                                                                                                                               ^^^^^^^^^^^^^^^^^^^
Did you mean?  filename_for_content_disposition):
[85a24b02-5752-463c-9181-e11d4caa6733]
[85a24b02-5752-463c-9181-e11d4caa6733] plugins/redmine_wktime/app/lib/timelog_controller_patch.rb:50:in `block (2 levels) in index'
[85a24b02-5752-463c-9181-e11d4caa6733] plugins/redmine_wktime/app/lib/timelog_controller_patch.rb:30:in `index'
[85a24b02-5752-463c-9181-e11d4caa6733] lib/redmine/sudo_mode.rb:61:in `sudo_mode'

Redmine version: 5.0.4 stable Ruby version: 3.1.2-p20 Ralis version: 6.1.7.3 Plugin version: 4.7.3

Many thanks!

cdhana17 commented 2 months ago

if you are using Redmine 5.0, then you should be using Erpmine 4.7, can you get 4.7 and see if it works fine ?

For Compatibility matrix, check https://erpmine.org/projects/erpmine/wiki/Download?page=Download

Thanks Dhanalakshmi

Q1984 commented 2 months ago

You are right! There was a version mismatch. Downgraded to 4.7 everything works fine. Thanks!