happy-se-life / kanban

Kanban plugin for redmine
https://it-managers-life.hatenablog.com/entry/2019/03/24/112052
MIT License
122 stars 38 forks source link

500 internal server error on filter #13

Closed yennor closed 4 years ago

yennor commented 4 years ago

When reapplying the default filter I get following error:

DEPRECATION WARNING: Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): "CASE assigned_to_id WHEN 'unspecified' THEN 1 ELSE 2 END, assigned_to_id DESC". Non-attribute arguments will be disallowed in Rails 6.0. This method should not be called with user-provided values, such as request parameters or model attributes. Known-safe values can be passed by wrapping them in Arel.sql(). (called from block in index at /usr/share/redmine/plugins/kanban/app/controllers/kanban_controller.rb:182) Completed 500 Internal Server Error in 46ms (ActiveRecord: 24.7ms)

ActiveRecord::StatementInvalid (PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "unspecified" LINE 1: ...s_private" = $8 ORDER BY CASE assigned_to_id WHEN 'unspecifi... ^ : SELECT "issues".* FROM "issues" WHERE ("issues"."assigned_to_id" IN ($1, $2, $3, $4, $5) OR "issues"."assigned_to_id" IS NULL) AND "issues"."project_id" = $6 AND "issues"."status_id" = $7 AND (updated_on >= '2020-04-21 00:00:00') AND "issues"."is_private" = $8 ORDER BY CASE assigned_to_id WHEN 'unspecified' THEN 1 ELSE 2 END, assigned_to_id DESC LIMIT $9):

plugins/kanban/app/controllers/kanban_controller.rb:187:in block (2 levels) in index' plugins/kanban/app/controllers/kanban_controller.rb:185:ineach' plugins/kanban/app/controllers/kanban_controller.rb:185:in block in index' plugins/kanban/app/controllers/kanban_controller.rb:173:ineach' plugins/kanban/app/controllers/kanban_controller.rb:173:in index' lib/redmine/sudo_mode.rb:63:insudo_mode'

happy-se-life commented 4 years ago

@yennor Hello,

Thank you for pointing out the problem. I have fixed the problem now. Check it out when you have the time.

yennor commented 4 years ago

works now