{"action":"opened","issue":{"url":"https://api.github.com/repos/4teamwork/opengever.core/issues/1951","repository_url":"https://api.github.com/repos/4teamwork/opengever.core","labels_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/1951/labels{/name}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/1951/comments","events_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/1951/events","html_url":"https://github.com/4teamwork/opengever.core/issues/1951","id":161380437,"number":1951,"title":"Filtering tasks results in invalid SQL WHERE clause","user":{"login":"lukasgraf","id":405124,"avatar_url":"https://avatars.githubusercontent.com/u/405124?v=3","gravatar_id":"","url":"https://api.github.com/users/lukasgraf","html_url":"https://github.com/lukasgraf","followers_url":"https://api.github.com/users/lukasgraf/followers","following_url":"https://api.github.com/users/lukasgraf/following{/other_user}","gists_url":"https://api.github.com/users/lukasgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/lukasgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukasgraf/subscriptions","organizations_url":"https://api.github.com/users/lukasgraf/orgs","repos_url":"https://api.github.com/users/lukasgraf/repos","events_url":"https://api.github.com/users/lukasgraf/events{/privacy}","received_events_url":"https://api.github.com/users/lukasgraf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-21T08:48:46Z","updated_at":"2016-06-21T08:48:46Z","closed_at":null,"body":"See [Sentry Issue #482](https://sentry.4teamwork.ch/sentry/onegov-gever/issues/482/):\r\n\r\n**Steps to reproduce**:\r\n\r\n- test.onegovgever.ch\r\n- personal overview\r\n- select \"My issued tasks\" tab\r\n- filter by some text\r\n\r\n**Results in**:\r\n\r\n```\r\nTraceback (innermost last):\r\n  Module ZPublisher.Publish, line 138, in publish\r\n  Module ZPublisher.mapply, line 77, in mapply\r\n  Module ZPublisher.Publish, line 48, in call_object\r\n  Module ftw.tabbedview.browser.tabbed, line 160, in listing\r\n  Module ftw.tabbedview.browser.listing, line 109, in __call__\r\n  Module ftw.tabbedview.browser.listing, line 197, in update\r\n  Module opengever.tabbedview.browser.sqltablelisting, line 114, in search_results\r\n  Module sqlalchemy.orm.query, line 2398, in all\r\n  Module sqlalchemy.orm.query, line 2515, in __iter__\r\n  Module sqlalchemy.orm.query, line 2530, in _execute_and_instances\r\n  Module sqlalchemy.engine.base, line 914, in execute\r\n  Module sqlalchemy.sql.elements, line 323, in _execute_on_connection\r\n  Module sqlalchemy.engine.base, line 1010, in _execute_clauseelement\r\n  Module sqlalchemy.engine.base, line 1146, in _execute_context\r\n  Module sqlalchemy.engine.base, line 1341, in _handle_dbapi_exception\r\n  Module sqlalchemy.util.compat, line 199, in raise_from_cause\r\n  Module sqlalchemy.engine.base, line 1139, in _execute_context\r\n  Module sqlalchemy.engine.default, line 450, in do_execute\r\nProgrammingError: (psycopg2.ProgrammingError) operator does not exist: integer ~~ unknown\r\nLINE 5: ... tasks.text LIKE '%foo%' OR tasks.sequence_number LIKE '%foo...\r\n```\r\n\r\nThe issue here is that `tasks.sequence_number` is an integer column, and needs to be casted to `VARCHAR` first before being used with the `LIKE` operator:\r\n\r\n```sql\r\nCAST(tasks.sequence_number AS VARCHAR) LIKE '%foo%'\r\n```\r\n"}}
{"actor":{"display_login":"lukasgraf"}}