]> source.dussan.org Git - redmine.git/commitdiff
Export to PDF fails when subject of parent task is included in issue list (#33103).
authorGo MAEDA <maeda@farend.jp>
Tue, 24 Mar 2020 12:16:06 +0000 (12:16 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 24 Mar 2020 12:16:06 +0000 (12:16 +0000)
Patch by Marius BALTEANU and Yuichi HARADA.

git-svn-id: http://svn.redmine.org/redmine/trunk@19611 e93f8b46-1217-0410-a6f0-8f06a7374b81

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

index 2f73e52a458914fc702fa087375be7a7e249450b..b496916957c4001d96c8e57aa09178d77526fb52 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 c9e4e4863e824c89153832ebe7ea34a4288c496b..07b2464247dbe1ce8b726306fe32ec20dab788bb 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