software-project / scrum-pm

Scrum PM is a plugin for Redmine ticket management system. It adds Scrum items like backlog, dashboard and others.
www.software-project.eu/EN/scrumpm
126 stars 47 forks source link

Postgress error #30

Closed aknarts closed 14 years ago

aknarts commented 14 years ago

Hello, today I installed this plugin on Redmine 0.9.3 and it works great(part from interfering with http://www.redmine.org/wiki/redmine/PluginCollapse with the page layout)

But when going to Dashboard I get internal server error and in server log this:

ActiveRecord::StatementInvalid (PGError: ERROR: operator does not exist: boolean = integer LINE 1: ...ssues".status_id WHERE (issue_statuses.is_closed = 0 AND us... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. : SELECT "issues".* FROM "issues" INNER JOIN "issue_statuses" ON "issue_statuses".id = "issues".status_id WHERE (issue_statuses.is_closed = 0 AND user_story_id IS NULL AND (fixed_version_id = 12 OR project_id = 3)) ): vendor/plugins/redmine_sprints/app/controllers/sprints_controller.rb:30:in show' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:instart_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:instart_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:ineach' /usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:instart' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'

I fixed the issue in vendor/plugins/redmine_sprints/app/controllers/sprints_controller.rb by changing "issues".status_id WHERE (issue_statuses.is_closed = 0 ... to "issues".status_id WHERE (issue_statuses.is_closed IS FALSE

this helped and it works fine for now. Dont know if there is any more changes needed to be made but we will se about that in some time(after some usage).

rapimo commented 14 years ago

don't hard code sql! you should use conditions like so: :conditions => ["issue_statuses.is_closed = ? AND user_story_id IS NULL AND (fixed_version_id = ? OR project_id = ?)",false, @sprint.id, @project.id ]

since postgres and mysql handle Boolean values different