Defect #33052

Missing subject and tracker name in CSV export of time entries report

Added by Sandra Tatarevicova 9 months ago. Updated 9 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Time tracking
Target version:4.0.7
Resolution:Fixed Affected version:4.0.0

Description

CSV exports of time entries report no longer contain issue subject and tracker name since Redmine 4.0.0.

Steps to reproduce:

  1. Go to a project
  2. Go to Spent time tab
  3. Go to Report tab
  4. Add Issue
  5. Click on CSV export link
  6. The exported CSV contains column Issue with only issue ID in the exported values. In previous versions (tested on Redmine 3.4.13) it contained values in the following format: #{obj.tracker} ##{obj.id}: #{obj.subject}.

Tested on clean Docker image redmine:4.0.0 and Redmine 4.1.0.

It seems it was broken in #29042.

0001-33052-fix-issue-text-format.patch Magnifier - Patch for the issue (2.29 KB) Kevin Fischer, 2020-03-02 04:19

0002-remove-unused-issue-argument.patch Magnifier - Improvement: Remove unused argument (1.62 KB) Kevin Fischer, 2020-03-02 04:19

0001-33052-fix-issue-text-format-v2.patch Magnifier - Patch for the issue (2.26 KB) Kevin Fischer, 2020-03-02 04:40

0001-Fix-missing-subject-and-tracker-name-in-CSV-export-o.patch Magnifier (2 KB) Marius BALTEANU, 2020-03-03 00:22

Associated revisions

Revision 19554
Added by Go MAEDA 9 months ago

Fix missing subject and tracker name in CSV export of time (#33052).

Patch by Kevin Fischer and Marius BALTEANU.

Revision 19557
Added by Go MAEDA 9 months ago

Merged r19554 from trunk to 4.1-stable (#33052).

Revision 19558
Added by Go MAEDA 9 months ago

Merged r19554 from trunk to 4.0-stable (#33052).

History

#1 Updated by Go MAEDA 9 months ago

  • Status changed from New to Confirmed
  • Affected version changed from 4.1.0 to 4.0.0

Redmine 3.4:

Issue,2007-3,2007-4,Total time
[none],"",7.65,7.65
Bug #1: Cannot print recipes,154.25,"",154.25
Bug #3: Error 281 when updating a recipe,"",1.00,1.00
Total time,154.25,8.65,162.90

trunk:

Issue,2007-3,2007-4,Total time
[none],"",7.65,7.65
#1,154.25,"",154.25
#3,"",1.00,1.00
Total time,154.25,8.65,162.90

#2 Updated by Kevin Fischer 9 months ago

I added a test to cover for this regressions and a possible fix for the issue in my first patch.
I'm not sure if a change in a place that central will have negative side effects.
I checked the few places where format_object was used outside of HTML templates and helpers and ran all unit tests locally and it seemed fine to me. What do you think?

My second patch just contains a minor source code improvement: Redmine::Helpers::TimeReport currently never uses the issue argument (which doesn't seem to be set to any value in that controller anyways), so I removed it to prevent confusion.

#3 Updated by Kevin Fischer 9 months ago

Oh sorry I realized I included an unnecessary line in the unit test.... this is the updated patch

#4 Updated by Marius BALTEANU 9 months ago

Kevin Fischer wrote:

I added a test to cover for this regressions and a possible fix for the issue in my first patch.
I'm not sure if a change in a place that central will have negative side effects.
I checked the few places where format_object was used outside of HTML templates and helpers and ran all unit tests locally and it seemed fine to me. What do you think?

Thanks Kevin for writing the patch. I think it's safer to fix this in timelog_helper.rb as it was before #29042, please find attached a slightly modified patch. Test results here

My second patch just contains a minor source code improvement: Redmine::Helpers::TimeReport currently never uses the issue argument (which doesn't seem to be set to any value in that controller anyways), so I removed it to prevent confusion.

Please open a new ticket with this patch.

#5 Updated by Go MAEDA 9 months ago

  • Status changed from Confirmed to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you.

#6 Updated by Go MAEDA 9 months ago

  • Status changed from Resolved to Closed

#7 Updated by Rohit Thakral 9 months ago

Guys, I can see this issue in the latest version 4.1.0 as well. Has anyone else been able to replicate it?

#8 Updated by Marius BALTEANU 9 months ago

Rohit Thakral wrote:

Guys, I can see this issue in the latest version 4.1.0 as well. Has anyone else been able to replicate it?

The fix will be available in the next releases (4.0.7, 4.1.1 and 4.2.0).

Also available in: Atom PDF