ascendro/redmine_issue_reminder — Issue #13: rake aborted - Unknown Column 'users.lastname' in 'order clause'
Author: MichaelKling
Created: 2012-03-04 21:01:11+00:00
State: open

The reminder wasn't working on a clients system (Redmine 1.2.0). I called it manually and got this:

:/opt/redmine-1.1.3$ rake --trace reminder:exec RAILS_ENV="production"
(in /opt/redmine-1.1.3)
** Invoke reminder:exec (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute reminder:exec
rake aborted!
Mysql::Error: Unknown column 'users.lastname' in 'order clause': SELECT `issues`.`id` AS t0_r0, `issues`.`tracker_id` AS t0_r1, `issues`.`pr oject_id` AS t0_r2, `issues`.`subject` AS t0_r3, `issues`.`description` AS t0_r4, `issues`.`due_date` AS t0_r5, `issues`.`category_id` AS t0 _r6, `issues`.`status_id` AS t0_r7, `issues`.`assigned_to_id` AS t0_r8, `issues`.`priority_id` AS t0_r9, `issues`.`fixed_version_id` AS t0_r 10, `issues`.`author_id` AS t0_r11, `issues`.`lock_version` AS t0_r12, `issues`.`created_on` AS t0_r13, `issues`.`updated_on` AS t0_r14, `is sues`.`start_date` AS t0_r15, `issues`.`done_ratio` AS t0_r16, `issues`.`estimated_hours` AS t0_r17, `issues`.`parent_id` AS t0_r18, `issues `.`root_id` AS t0_r19, `issues`.`lft` AS t0_r20, `issues`.`rgt` AS t0_r21, `issues`.`is_private` AS t0_r22, `projects`.`id` AS t1_r0, `proje cts`.`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`.`dmsf_description` AS t1_r12, `issue_statuses`.`id` AS t2_r0, `iss ue_statuses`.`name` AS t2_r1, `issue_statuses`.`is_closed` AS t2_r2, `issue_statuses`.`is_default` AS t2_r3, `issue_statuses`.`position` AS t2_r4, `issue_statuses`.`default_done_ratio` AS t2_r5 FROM `issues` LEFT OUTER JOIN `projects` ON `projects`.id = `issues`.project_id LEFT OUTER JOIN `issue_statuses` ON `issue_statuses`.id = `issues`.status_id WHERE (((issue_statuses.is_closed=0) AND projects.id IN (8,91,84,95 ,86,94,85,93,83,89,82,78,81,79,96,88,80,92,87,77,90,72))) AND (((projects.status=1 AND projects.id IN (SELECT em.project_id FROM enabled_mod ules em WHERE em.name='issue_tracking')) AND ((projects.id IN (8) AND ((issues.author_id = 16 OR issues.assigned_to_id = 16))) OR (projects. id IN (8) AND ((issues.author_id = 16 OR issues.assigned_to_id = 16))) OR (projects.id IN (8) AND ((issues.author_id = 16 OR issues.assigned _to_id = 16)))))) ORDER BY users.lastname ,users.firstname ,users.id
On line #13 of vendor/plugins/redmine_issue_reminder/app/views/reminder_mailer/issues_reminder.html.erb

10:

11:

12:

13: <% data[1].issues.each do |issue| %>
14:

15: <% data[1].columns.each do |column| %>
16: <%= content_tag 'td', content_for_column(column, issue) %>

app/models/query.rb:553:in `issues'
vendor/plugins/redmine_issue_reminder/app/views/reminder_mailer/issues_reminder.html.erb:13
vendor/plugins/redmine_issue_reminder/app/views/reminder_mailer/issues_reminder.html.erb:1:in `each'
vendor/plugins/redmine_issue_reminder/app/views/reminder_mailer/issues_reminder.html.erb:1
/usr/lib/ruby/1.8/rake.rb:636:in `call'
/usr/lib/ruby/1.8/rake.rb:636:in `execute'
/usr/lib/ruby/1.8/rake.rb:631:in `each'
/usr/lib/ruby/1.8/rake.rb:631:in `execute'
/usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/rake.rb:583:in `invoke'
/usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2029:in `each'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2001:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28