]> source.dussan.org Git - redmine.git/commitdiff
Merged r19611 from trunk to 4.1-stable (#33103).
authorGo MAEDA <maeda@farend.jp>
Tue, 24 Mar 2020 12:17:56 +0000 (12:17 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 24 Mar 2020 12:17:56 +0000 (12:17 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19612 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/export/pdf/issues_pdf_helper.rb
test/unit/lib/redmine/export/pdf/issues_pdf_test.rb

index 652622755c3b0a6bf1e498b5474b100797b86463..69cc813e2bff8f66c7a2f79437f2543dcfef7462 100644 (file)
@@ -379,7 +379,7 @@ module Redmine
                 cv = issue.visible_custom_field_values.detect {|v| v.custom_field_id == column.custom_field.id}
                 show_value(cv, false)
               else
-                value = issue.send(column.name)
+                value = column.value_object(issue)
                 case column.name
                 when :subject
                   value = "  " * level + value
index fbeb853f4917e0fc05eea9b106a8a5fd760efd1d..4c12c326266ff51f37e5c9dbf11492034e0a7b73 100644 (file)
@@ -36,4 +36,15 @@ class IssuesPdfHelperTest < ActiveSupport::TestCase
     results = fetch_row_values(issue, query, 0)
     assert_equal ["2", "Add ingredients categories", "4.34"], results
   end
+
+  def test_fetch_row_values_should_be_able_to_handle_parent_issue_subject
+    query = IssueQuery.new(:project => Project.find(1), :name => '_')
+    query.column_names = [:subject, 'parent.subject']
+    issue = Issue.find(2)
+    issue.parent = Issue.find(1)
+    issue.save!
+
+    results = fetch_row_values(issue, query, 0)
+    assert_equal ['2', 'Add ingredients categories', 'Cannot print recipes'], results
+  end
 end