Project

General

Profile

Error in Locale Float Format plugin

Added by Antonio Albuquerque 3 days ago

we are using Redmine v. 5.1.3 and Locale Float Format plugin version 0.0.4

When exporting CSV that contain decimal value columns, an ERROR 500 occurs on the server, as can be seen in the log: "`format_object_with_locale_decimal_separator'"

Two messages in the log caught our attention:
1) "plugins/redmine_kanban/lib/redmine_kanban/patches/queries_helper_patch.rb:42:in `query_to_csv_with_kanban' " : we do not have any plugin installed on the machine.

2) "NoMethodError (undefined method `number_with_delimiter' for #<IssuesController:0x000000000a3138>"

Below we transcribe a more complete excerpt from the log:

I, [2024-11-18T10:36:16.212278 #190947] INFO -- : [9f747af1-f251-4467-8e02-fdcb94cf1bfd] Started GET "/projects/planj_orcament/issues.csv?utf8=%E2%9C%93&set_filter=1&f%5B%5D=status_id&op%5Bstatus_id%5D=*&v%5Bstatus_id%5D%5B%5D=&c%5B%5D=id&c%5B%5D=subject&c%5B%5D=status&c%5B%5D=tracker&c%5B%5D=assigned_to&c%5B%5D=cf_9&c%5B%5D=cf_27&c%5B%5D=due_date&t%5B%5D=cf_9&t%5B%5D=cf_27&sort=cf_9%3Adesc&query_name=Valor&c%5B%5D=&encoding=UTF-8&field_separator=%2C" for 10.1.41.74 at 2024-11-18 10:36:16 0300
I, [2024-11-18T10:36:16.213356 #190947] INFO -
: [9f747af1-f251-4467-8e02-fdcb94cf1bfd] Processing by IssuesController#index as CSV
I, [2024-11-18T10:36:16.213408 #190947] INFO -- : [9f747af1-f251-4467-8e02-fdcb94cf1bfd] Parameters: {"utf8"=>"✓", "set_filter"=>"1", "f"=>["status_id"], "op"=>{"status_id"=>"*"}, "v"=>{"status_id"=>[""]}, "c"=>["id", "subject", "status", "tracker", "assigned_to", "cf_9", "cf_27", "due_date", ""], "t"=>["cf_9", "cf_27"], "sort"=>"cf_9:desc", "query_name"=>"Valor", "encoding"=>"UTF-8", "field_separator"=>",", "project_id"=>"planj_orcament"}
I, [2024-11-18T10:36:16.218533 #190947] INFO -- : [9f747af1-f251-4467-8e02-fdcb94cf1bfd] Current user: antonio.albuquerque (id=8)
I, [2024-11-18T10:36:16.332944 #190947] INFO -- : [9f747af1-f251-4467-8e02-fdcb94cf1bfd] Completed 500 Internal Server Error in 119ms (ActiveRecord: 23.9ms | Allocations: 67068)
F, [2024-11-18T10:36:16.334367 #190947] FATAL -- : [9f747af1-f251-4467-8e02-fdcb94cf1bfd]
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] NoMethodError (undefined method `number_with_delimiter' for #<IssuesController:0x000000000a3138>

number_with_delimiter(sprintf('%.2f', object))
^^^^^^^^^^^^^^^^^^^):
[9f747af1-f251-4467-8e02-fdcb94cf1bfd]
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] plugins/locale_float_format/lib/locale_float_format.rb:7:in `format_object_with_locale_decimal_separator'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] app/helpers/application_helper.rb:305:in `format_object'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] plugins/locale_float_format/lib/locale_float_format.rb:9:in `format_object_with_locale_decimal_separator'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] app/helpers/queries_helper.rb:304:in `csv_value'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] app/helpers/queries_helper.rb:295:in `csv_content'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] app/helpers/queries_helper.rb:331:in `block (3 levels) in query_to_csv'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] app/helpers/queries_helper.rb:331:in `map'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] app/helpers/queries_helper.rb:331:in `block (2 levels) in query_to_csv'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] app/helpers/queries_helper.rb:330:in `each'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] app/helpers/queries_helper.rb:330:in `block in query_to_csv'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] lib/redmine/export/csv.rb:44:in `generate'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] lib/redmine/export/csv.rb:26:in `generate'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] app/helpers/queries_helper.rb:326:in `query_to_csv'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] plugins/redmine_kanban/lib/redmine_kanban/patches/queries_helper_patch.rb:42:in `query_to_csv_with_kanban'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] app/controllers/issues_controller.rb:76:in `block (2 levels) in index'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] app/controllers/issues_controller.rb:51:in `index'
[9f747af1-f251-4467-8e02-fdcb94cf1bfd] lib/redmine/sudo_mode.rb:61:in `sudo_mode'