]> source.dussan.org Git - redmine.git/commitdiff
Merged r19646 to 4.0-stable (#33075).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 5 Apr 2020 08:15:19 +0000 (08:15 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 5 Apr 2020 08:15:19 +0000 (08:15 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@19650 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/queries_helper.rb
test/functional/timelog_controller_test.rb

index 01d10d883cffadc15c9d1ef013dd1d949fac4432..5c03790086095da7d7ae26ef6b1e52dbbe9d5dc4 100644 (file)
@@ -261,7 +261,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
index 11d697137557ab9dea2599a4d1488ba6f96d594f..d4c07c816c755f2f4c2a9814f522dc3c44fa09ce 100644 (file)
@@ -1270,4 +1270,17 @@ class TimelogControllerTest < Redmine::ControllerTest
     assert_not_nil line
     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
 end