From 69a7c3691d50bdf4c08cce879554ff1570d52913 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 5 Apr 2020 08:12:44 +0000 Subject: [PATCH] Merged r19646 to 4.1-stable (#33075). git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19649 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/queries_helper.rb | 2 +- test/functional/timelog_controller_test.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index 33332a676..991ef93c8 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -273,7 +273,7 @@ module QueriesHelper value.to_s(object) when 'Issue' if object.is_a?(TimeEntry) - "#{value.tracker} ##{value.id}: #{value.subject}" + value.visible? ? "#{value.tracker} ##{value.id}: #{value.subject}" : "##{value.id}" else value.id end diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index 360ea14b1..700362f18 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -1418,6 +1418,19 @@ class TimelogControllerTest < Redmine::ControllerTest assert_include "#{issue.tracker} #1: #{issue.subject}", line end + def test_index_csv_should_fill_issue_column_with_issue_id_if_issue_that_is_not_visible + @request.session[:user_id] = 3 + issue = Issue.generate!(:author_id => 1, :is_private => true) + entry = TimeEntry.generate!(:issue => issue, :comments => "Issue column content test") + + get :index, :params => {:format => 'csv'} + assert_not issue.visible? + line = response.body.split("\n").detect {|l| l.include?(entry.comments)} + assert_not_nil line + assert_not_include "#{issue.tracker} ##{issue.id}: #{issue.subject}", line + assert_include "##{issue.id}", line + end + def test_index_grouped_by_created_on skip unless TimeEntryQuery.new.groupable_columns.detect {|c| c.name == :created_on} -- 2.39.5