concerto / concerto

Concerto Digital Signage System
http://www.concerto-signage.org
Other
414 stars 160 forks source link

Changing content causes 500 when using non-English language #1411

Closed brandsjek closed 6 years ago

brandsjek commented 7 years ago

A client is using Concerto in the Dutch language and receives a HTTP 500 when updating content (in the following example, the client attempts to add a feed to a image). The following is the output of production.log at the moment of failure:

I, [2017-04-05T11:33:02.395785 #9659]  INFO -- : Processing by ContentsController#add_feed as JS
I, [2017-04-05T11:33:02.395864 #9659]  INFO -- :   Parameters: {"feed_id"=>"4", "feed_index"=>"4"}
I, [2017-04-05T11:33:02.434240 #9659]  INFO -- :   Rendered contents/form_elements/_selected_feed_display.html.erb (31.4ms)
I, [2017-04-05T11:33:02.434918 #9659]  INFO -- :   Rendered contents/add_feed.js.erb (32.3ms)
I, [2017-04-05T11:33:02.435268 #9659]  INFO -- : Completed 200 OK in 39ms (Views: 32.4ms | ActiveRecord: 1.3ms)
I, [2017-04-05T11:33:03.070268 #9659]  INFO -- : Started GET "/frontend/3/fields/1/contents.json" for 81.28.91.111 at 2017-04-05 11:33:03 +0200
I, [2017-04-05T11:33:03.071828 #9659]  INFO -- : Processing by Frontend::ContentsController#index as JSON
I, [2017-04-05T11:33:03.071910 #9659]  INFO -- :   Parameters: {"screen_id"=>"3", "field_id"=>"1"}
I, [2017-04-05T11:33:03.303934 #9659]  INFO -- : Completed 200 OK in 232ms (Views: 0.2ms | ActiveRecord: 7.7ms)
I, [2017-04-05T11:33:05.615621 #9659]  INFO -- : Started PATCH "/content/49" for 81.28.91.111 at 2017-04-05 11:33:05 +0200
I, [2017-04-05T11:33:05.617525 #9659]  INFO -- : Processing by ContentsController#update as HTML
I, [2017-04-05T11:33:05.617674 #9659]  INFO -- :   Parameters: {"utf8"=>"✓", "authenticity_token"=>"vb1wG6xCaKO5OGxNQiZykVf/9g80ZbCwisr+I7hW/9DXb+kIb9DBaaaDmw9HRTga8dolmHYf7Y4TEC9o+jenlA==", "type"=>"Graphic", "graphic"=>{"name"=>"Samsung curved monitor - test naar aanleiding van ticket omdat er mogelijk een bug in Concerto zit", "start_time"=>{"date"=>"04/04/2017", "time"=>"10:00 's middags"}, "end_time"=>{"date"=>"04/12/2017", "time"=>"09:59 's middags"}, "duration"=>"8"}, "feed_id"=>{"0"=>"3", "4"=>"4"}, "commit"=>"Submit Content", "id"=>"49"}
I, [2017-04-05T11:33:05.636737 #9659]  INFO -- : Completed 500 Internal Server Error in 19ms (ActiveRecord: 1.3ms)
F, [2017-04-05T11:33:05.640106 #9659] FATAL -- :
I, [2017-04-05T11:33:05.646896 #9659]  INFO -- : Processing by ErrorsController#render_error as HTML
I, [2017-04-05T11:33:05.647114 #9659]  INFO -- :   Parameters: {"utf8"=>"✓", "authenticity_token"=>"_censored_", "type"=>"Graphic", "graphic"=>{"name"=>"Samsung curved monitor - test naar aanleiding van ticket omdat er mogelijk een bug in Concerto zit", "start_time"=>{"date"=>"04/04/2017", "time"=>"10:00 's middags"}, "end_time"=>{"date"=>"04/12/2017", "time"=>"09:59 's middags"}, "duration"=>"8"}, "feed_id"=>{"0"=>"3", "4"=>"4"}, "commit"=>"Submit Content", "id"=>"49"}
I, [2017-04-05T11:33:05.653278 #9659]  INFO -- :   Rendered errors/error_generic.html.erb within layouts/no-topmenu (1.2ms)
I, [2017-04-05T11:33:05.654690 #9659]  INFO -- :   Rendered elements/_head.html.erb (0.0ms)
I, [2017-04-05T11:33:05.655207 #9659]  INFO -- : Completed 500 Internal Server Error in 8ms (Views: 6.4ms | ActiveRecord: 0.1ms)

Note that the time parameter uses Dutch words to describe time. This probably causes the crash as I presume this should be provided in AM/PM style.

Xeondile commented 7 years ago

I have the same problem with german date and time, at the moment i figured it out why it happens and try to change the code for that so it will use the locale settings of the user. For saving the content, the problem is that the converter for datetime to bring it in the database only accepts english date and am/pm time.

mfrederickson commented 6 years ago

Jquery timepicker needs an option set for am vs. pm. In German this would be vormittags and nachmittags, correct @Xeondile ? What about in Dutch @Flippylosaurus ?

mfrederickson commented 6 years ago

Can't get strptime to parse it with those either...

mfrederickson commented 6 years ago

Aha. See solution provided here https://github.com/concerto/concerto/issues/1340

Xeondile commented 6 years ago

yes in german it would be vormittags and nachmittags

mfrederickson commented 6 years ago

Closing this. It can be followed in #1340