happy-se-life / kanban

Kanban plugin for redmine

Home Page:https://it-managers-life.hatenablog.com/entry/2019/03/24/112052

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

500 internal server error on filter

yennor opened this issue · comments

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:in each'
plugins/kanban/app/controllers/kanban_controller.rb:185:in block in index' plugins/kanban/app/controllers/kanban_controller.rb:173:in each'
plugins/kanban/app/controllers/kanban_controller.rb:173:in index' lib/redmine/sudo_mode.rb:63:in sudo_mode'

@yennor
Hello,

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

works now