Defect #14366

Spent Time report sorting on custom fields causes error

Added by Robert Barnebeck over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Time tracking
Target version:2.3.3
Resolution:Fixed Affected version:2.3.2

Description

Since the last version of Redmine it is possible to add custom fields of a Log Time entry in the Spent Time report, which is very cool by the way :-). If I want to sort by this custom field, then it causes an "Internal Error". Here an example URL, which is called by the sorting Link:

https://ticketsystem.de/projects/xyz/time_entries?c[]=project&c[]=spent_on&c[]=user&c[]=activity&c[]=issue&c[]=comments&c[]=hours&c[]=cf_3&f[]=spent_on&f[]=&op[spent_on]=*&sort=cf_3%2Chours%2Cspent_on%3Adesc&utf8=%E2%9C%93


Related issues

Duplicates Redmine - Defect #14362: Spent Time report sorting on custom fields causes error Closed

Associated revisions

Revision 12042
Added by Jean-Philippe Lang over 4 years ago

Fixed that sorting time entries by custom field raises a SQL error (#14366).

Revision 12043
Added by Jean-Philippe Lang over 4 years ago

Merged r12042 from trunk (#14366).

History

#1 Updated by Toshi MARUYAMA over 4 years ago

  • Duplicates Defect #14362: Spent Time report sorting on custom fields causes error added

#2 Updated by Jamie Gruener over 4 years ago

Confirmed. I see this behavior, too.

#3 Updated by Etienne Massip over 4 years ago

  • Status changed from New to Confirmed
  • Target version set to 2.3.3
  • Affected version (unused) changed from 2.3.1 to 2.3.2
  • Affected version changed from 2.3.1 to 2.3.2

Confirmed on 2.3_stable.

ActiveRecord::StatementInvalid (SQLite3::SQLException: no such column: cf_1.value: SELECT  "time_entries"."id" AS t0_r0, "time_entries"."project_id" AS t0_r1, "time_entries"."user_id" AS t0_r2, "time_entries"."issue_id" AS t0_r3, "time_entries"."hours" AS t0_r4, "time_entries"."comments" AS t0_r5, "time_entries"."activity_id" AS t0_r6, "time_entries"."spent_on" AS t0_r7, "time_entries"."tyear" AS t0_r8, "time_entries"."tmonth" AS t0_r9, "time_entries"."tweek" AS t0_r10, "time_entries"."created_on" AS t0_r11, "time_entries"."updated_on" AS t0_r12, "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, "enumerations"."id" AS t2_r0, "enumerations"."name" AS t2_r1, "enumerations"."position" AS t2_r2, "enumerations"."is_default" AS t2_r3, "enumerations"."type" AS t2_r4, "enumerations"."active" AS t2_r5, "enumerations"."project_id" AS t2_r6, "enumerations"."parent_id" AS t2_r7, "enumerations"."position_name" AS t2_r8, "users"."id" AS t3_r0, "users"."login" AS t3_r1, "users"."hashed_password" AS t3_r2, "users"."firstname" AS t3_r3, "users"."lastname" AS t3_r4, "users"."mail" AS t3_r5, "users"."admin" AS t3_r6, "users"."status" AS t3_r7, "users"."last_login_on" AS t3_r8, "users"."language" AS t3_r9, "users"."auth_source_id" AS t3_r10, "users"."created_on" AS t3_r11, "users"."updated_on" AS t3_r12, "users"."type" AS t3_r13, "users"."identity_url" AS t3_r14, "users"."mail_notification" AS t3_r15, "users"."salt" AS t3_r16, "issues"."id" AS t4_r0, "issues"."tracker_id" AS t4_r1, "issues"."project_id" AS t4_r2, "issues"."subject" AS t4_r3, "issues"."description" AS t4_r4, "issues"."due_date" AS t4_r5, "issues"."category_id" AS t4_r6, "issues"."status_id" AS t4_r7, "issues"."assigned_to_id" AS t4_r8, "issues"."priority_id" AS t4_r9, "issues"."fixed_version_id" AS t4_r10, "issues"."author_id" AS t4_r11, "issues"."lock_version" AS t4_r12, "issues"."created_on" AS t4_r13, "issues"."updated_on" AS t4_r14, "issues"."start_date" AS t4_r15, "issues"."done_ratio" AS t4_r16, "issues"."estimated_hours" AS t4_r17, "issues"."parent_id" AS t4_r18, "issues"."root_id" AS t4_r19, "issues"."lft" AS t4_r20, "issues"."rgt" AS t4_r21, "issues"."is_private" AS t4_r22, "issues"."closed_on" AS t4_r23, "trackers"."id" AS t5_r0, "trackers"."name" AS t5_r1, "trackers"."is_in_chlog" AS t5_r2, "trackers"."position" AS t5_r3, "trackers"."is_in_roadmap" AS t5_r4, "trackers"."fields_bits" AS t5_r5 FROM "time_entries" LEFT OUTER JOIN "projects" ON "projects"."id" = "time_entries"."project_id" LEFT OUTER JOIN "enumerations" ON "enumerations"."id" = "time_entries"."activity_id" AND "enumerations"."type" IN ('TimeEntryActivity') LEFT OUTER JOIN "users" ON "users"."id" = "time_entries"."user_id" AND "users"."type" IN ('User', 'AnonymousUser') LEFT OUTER JOIN "issues" ON "issues"."id" = "time_entries"."issue_id" LEFT OUTER JOIN "trackers" ON "trackers"."id" = "issues"."tracker_id" WHERE (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='time_tracking')) AND ((time_entries.spent_on IS NOT NULL) AND projects.id = 1) AND ((projects.id = 1 OR (projects.lft > 1 AND projects.rgt < 2))) ORDER BY COALESCE(cf_1.value, ''), time_entries.spent_on DESC, time_entries.created_on DESC LIMIT 25 OFFSET 0):
  app/controllers/timelog_controller.rb:56:in `block (2 levels) in index'
  app/controllers/timelog_controller.rb:51:in `index'

#4 Updated by Jean-Philippe Lang over 4 years ago

  • Status changed from Confirmed to Closed
  • Resolution set to Fixed

Fixed in r12042, thanks for pointing this out.

Also available in: Atom PDF