Project

General

Profile

Error in Locale Float Format plugin

Added by Antonio Albuquerque about 1 month 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'

Replies (2)

RE: Error in Locale Float Format plugin - Added by Antonio Albuquerque 26 days ago

Another log:

I, [2024-11-26T08:22:13.691545 #490671]  INFO -- : [61d0cca3-2b80-4383-b7de-edb3283c1a11] Started GET "/stylesheets/jquery/images/ui-icons_222222_256x240.png" for 10.1.41.74 at 2024-11-26 08:22:13 -0300
F, [2024-11-26T08:22:13.692005 #490671] FATAL -- : [61d0cca3-2b80-4383-b7de-edb3283c1a11]   
[61d0cca3-2b80-4383-b7de-edb3283c1a11] ActionController::RoutingError (No route matches [GET] "/stylesheets/jquery/images/ui-icons_222222_256x240.png"):
[61d0cca3-2b80-4383-b7de-edb3283c1a11]   
I, [2024-11-26T08:22:22.345042 #490671]  INFO -- : [ee8e43cd-e046-4166-98fb-cca008731496] Started GET "/projects/cont_orca2025/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_27&c%5B%5D=due_date&t%5B%5D=cf_9&t%5B%5D=cf_27&sort=cf_9%3Adesc&query_name=_&c%5B%5D=&encoding=UTF-8&field_separator=%2C" for 10.1.41.74 at 2024-11-26 08:22:22 -0300
I, [2024-11-26T08:22:22.346712 #490671]  INFO -- : [ee8e43cd-e046-4166-98fb-cca008731496] Processing by IssuesController#index as CSV
I, [2024-11-26T08:22:22.347004 #490671]  INFO -- : [ee8e43cd-e046-4166-98fb-cca008731496]   Parameters: {"utf8"=>"✓", "set_filter"=>"1", "f"=>["status_id"], "op"=>{"status_id"=>"*"}, "v"=>{"status_id"=>[""]}, "c"=>["id", "subject", "status", "tracker", "assigned_to", "cf_27", "due_date", ""], "t"=>["cf_9", "cf_27"], "sort"=>"cf_9:desc", "query_name"=>"_", "encoding"=>"UTF-8", "field_separator"=>",", "project_id"=>"cont_orca2025"}
I, [2024-11-26T08:22:22.354510 #490671]  INFO -- : [ee8e43cd-e046-4166-98fb-cca008731496]   Current user: antonio.albuquerque (id=8)
I, [2024-11-26T08:22:22.498002 #490671]  INFO -- : [ee8e43cd-e046-4166-98fb-cca008731496] Completed 500 Internal Server Error in 151ms (ActiveRecord: 29.3ms | Allocations: 67788)
F, [2024-11-26T08:22:22.499267 #490671] FATAL -- : [ee8e43cd-e046-4166-98fb-cca008731496]   
[ee8e43cd-e046-4166-98fb-cca008731496] NoMethodError (undefined method `number_with_delimiter' for #<IssuesController:0x00000000045088>

          number_with_delimiter(sprintf('%.2f', object))
          ^^^^^^^^^^^^^^^^^^^^^):
[ee8e43cd-e046-4166-98fb-cca008731496]   
[ee8e43cd-e046-4166-98fb-cca008731496] plugins/locale_float_format/lib/locale_float_format.rb:7:in `format_object_with_locale_decimal_separator'
[ee8e43cd-e046-4166-98fb-cca008731496] app/helpers/application_helper.rb:305:in `format_object'
[ee8e43cd-e046-4166-98fb-cca008731496] plugins/locale_float_format/lib/locale_float_format.rb:9:in `format_object_with_locale_decimal_separator'
[ee8e43cd-e046-4166-98fb-cca008731496] app/helpers/queries_helper.rb:304:in `csv_value'
[ee8e43cd-e046-4166-98fb-cca008731496] app/helpers/queries_helper.rb:295:in `csv_content'
[ee8e43cd-e046-4166-98fb-cca008731496] app/helpers/queries_helper.rb:331:in `block (3 levels) in query_to_csv'
[ee8e43cd-e046-4166-98fb-cca008731496] app/helpers/queries_helper.rb:331:in `map'
[ee8e43cd-e046-4166-98fb-cca008731496] app/helpers/queries_helper.rb:331:in `block (2 levels) in query_to_csv'
[ee8e43cd-e046-4166-98fb-cca008731496] app/helpers/queries_helper.rb:330:in `each'
[ee8e43cd-e046-4166-98fb-cca008731496] app/helpers/queries_helper.rb:330:in `block in query_to_csv'
[ee8e43cd-e046-4166-98fb-cca008731496] lib/redmine/export/csv.rb:44:in `generate'
[ee8e43cd-e046-4166-98fb-cca008731496] lib/redmine/export/csv.rb:26:in `generate'
[ee8e43cd-e046-4166-98fb-cca008731496] app/helpers/queries_helper.rb:326:in `query_to_csv'
[ee8e43cd-e046-4166-98fb-cca008731496] app/controllers/issues_controller.rb:76:in `block (2 levels) in index'
[ee8e43cd-e046-4166-98fb-cca008731496] app/controllers/issues_controller.rb:51:in `index'

RE: Error in Locale Float Format plugin - Added by Holger Just 26 days ago

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.

If your stack trace includes this plugin, you definitely have it installed.

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

The plugin may be incompatible with your version of Redmine. Usually, it is best to contact the plugin author(s) here.

In any case, note that Redmine 6.0 already ships with localized float values by default. See #22024.

    (1-2/2)