{"action":"created","issue":{"url":"https://api.github.com/repos/maxrossello/redmine_app_timesheets/issues/51","labels_url":"https://api.github.com/repos/maxrossello/redmine_app_timesheets/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/maxrossello/redmine_app_timesheets/issues/51/comments","events_url":"https://api.github.com/repos/maxrossello/redmine_app_timesheets/issues/51/events","html_url":"https://github.com/maxrossello/redmine_app_timesheets/issues/51","id":80834605,"number":51,"title":"Adding time gives SQL error due to blank version?","user":{"login":"sammcj","id":862951,"avatar_url":"https://avatars.githubusercontent.com/u/862951?v=3","gravatar_id":"","url":"https://api.github.com/users/sammcj","html_url":"https://github.com/sammcj","followers_url":"https://api.github.com/users/sammcj/followers","following_url":"https://api.github.com/users/sammcj/following{/other_user}","gists_url":"https://api.github.com/users/sammcj/gists{/gist_id}","starred_url":"https://api.github.com/users/sammcj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sammcj/subscriptions","organizations_url":"https://api.github.com/users/sammcj/orgs","repos_url":"https://api.github.com/users/sammcj/repos","events_url":"https://api.github.com/users/sammcj/events{/privacy}","received_events_url":"https://api.github.com/users/sammcj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/maxrossello/redmine_app_timesheets/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-26T07:23:26Z","updated_at":"2015-05-26T07:29:55Z","closed_at":null,"body":"We're getting an error when trying to add time to any tickets after upgrading to Redmine 2.6.5 and the latest timesheets plugin.\r\n\r\nI've also tried older versions of the timesheets plugin but it doesn't help:\r\n\r\n```\r\nActiveRecord::StatementInvalid (PG::InvalidTextRepresentation: ERROR:  invalid input syntax for integer: \"\"\r\nLINE 1: ...ND projects.status <> 9) AND (versions.id NOT IN ('')) AND (...\r\n                                                             ^\r\n: SELECT \"versions\".\"id\" AS t0_r0, \"versions\".\"project_id\" AS t0_r1, \"versions\".\"name\" AS t0_r2, \"versions\".\"description\" AS t0_r3, \"versions\".\"effective_date\" AS t0_r4, \"versions\".\"created_on\" AS t0_r5, \"versions\".\"updated_on\" AS t0_r6, \"versions\".\"wiki_page_title\" AS t0_r7, \"versions\".\"status\" AS t0_r8, \"versions\".\"sharing\" AS t0_r9, \"versions\".\"in_timesheet\" AS t0_r10, \"versions\".\"is_order\" AS t0_r11, \"projects\".\"id\" AS t1_r0, \"projects\".\"name\" AS t1_r1, \"projects\".\"description\" AS t1_r2, \"projects\".\"homepage\" AS t1_r3, \"projects\".\"is_public\" AS t1_r4, \"projects\".\"parent_id\" AS t1_r5, \"projects\".\"created_on\" AS t1_r6, \"projects\".\"updated_on\" AS t1_r7, \"projects\".\"identifier\" AS t1_r8, \"projects\".\"status\" AS t1_r9, \"projects\".\"lft\" AS t1_r10, \"projects\".\"rgt\" AS t1_r11, \"projects\".\"inherit_members\" AS t1_r12 FROM \"versions\" LEFT OUTER JOIN \"projects\" ON \"projects\".\"id\" = \"versions\".\"project_id\" WHERE (projects.lft >= 353 AND projects.rgt <= 354 AND projects.status <> 9) AND (versions.id NOT IN ('')) AND (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking'))):\r\n  app/controllers/versions_controller.rb:40:in `block (2 levels) in index'\r\n  app/controllers/versions_controller.rb:32:in `index'\r\n```\r\n\r\n\r\n```\r\nEnvironment:\r\n  Redmine version                2.6.5.stable.12119\r\n  Ruby version                   2.1.5-p273 (2014-11-13) [x86_64-linux]\r\n  Rails version                  3.2.21\r\n  Environment                    production\r\n  Database adapter               PostgreSQL\r\nSCM:\r\n  Subversion                     1.6.17\r\n  Cvs                            1.12.13\r\n  Git                            1.7.10.4\r\n  Filesystem                     \r\nRedmine plugins:\r\n  a_common_libs                  1.1.1\r\n  ixa_hacks                      0.0.1\r\n  redmine_agile                  1.3.9\r\n  redmine_app__space             1.0.3\r\n  redmine_app_timesheets         1.5.3\r\n  redmine_contacts               3.4.5\r\n  redmine_contacts_helpdesk      2.4.0\r\n  redmine_favorite_projects      1.0.1\r\n  redmine_issue_checklist        2.0.5\r\n  redmine_rouge                  0.0.1\r\n  redmine_spent_time_in_issue_description 2.6\r\n```"},"comment":{"url":"https://api.github.com/repos/maxrossello/redmine_app_timesheets/issues/comments/105426214","html_url":"https://github.com/maxrossello/redmine_app_timesheets/issues/51#issuecomment-105426214","issue_url":"https://api.github.com/repos/maxrossello/redmine_app_timesheets/issues/51","id":105426214,"user":{"login":"maxrossello","id":4066651,"avatar_url":"https://avatars.githubusercontent.com/u/4066651?v=3","gravatar_id":"","url":"https://api.github.com/users/maxrossello","html_url":"https://github.com/maxrossello","followers_url":"https://api.github.com/users/maxrossello/followers","following_url":"https://api.github.com/users/maxrossello/following{/other_user}","gists_url":"https://api.github.com/users/maxrossello/gists{/gist_id}","starred_url":"https://api.github.com/users/maxrossello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxrossello/subscriptions","organizations_url":"https://api.github.com/users/maxrossello/orgs","repos_url":"https://api.github.com/users/maxrossello/repos","events_url":"https://api.github.com/users/maxrossello/events{/privacy}","received_events_url":"https://api.github.com/users/maxrossello/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T07:29:55Z","updated_at":"2015-05-26T07:29:55Z","body":"Hi, \r\nas I do not have a PostgreSQL installation right now, can you please check what is the syntax that it is required for an empty IN clause?\r\nWould <pre>versions.id NOT IN (\"\")</pre> be accepted or must it be <pre>versions.id NOT IN ()</pre>?\r\n\r\nThank you"}}