summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-03-24 12:17:56 +0000
committerGo MAEDA <maeda@farend.jp>2020-03-24 12:17:56 +0000
commit3edca906dbdf1be6ac81d6408755e5d94ad05a90 (patch)
treeb596d391c87e0d0200dd07860b2eac9a7c10defa
parent74065dc7cf81e6948de688bb395d894e0be61e02 (diff)
downloadredmine-3edca906dbdf1be6ac81d6408755e5d94ad05a90.tar.gz
redmine-3edca906dbdf1be6ac81d6408755e5d94ad05a90.zip
Merged r19611 from trunk to 4.1-stable (#33103).
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19612 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/export/pdf/issues_pdf_helper.rb2
-rw-r--r--test/unit/lib/redmine/export/pdf/issues_pdf_test.rb11
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/redmine/export/pdf/issues_pdf_helper.rb b/lib/redmine/export/pdf/issues_pdf_helper.rb
index 652622755..69cc813e2 100644
--- a/lib/redmine/export/pdf/issues_pdf_helper.rb
+++ b/lib/redmine/export/pdf/issues_pdf_helper.rb
@@ -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
diff --git a/test/unit/lib/redmine/export/pdf/issues_pdf_test.rb b/test/unit/lib/redmine/export/pdf/issues_pdf_test.rb
index fbeb853f4..4c12c3262 100644
--- a/test/unit/lib/redmine/export/pdf/issues_pdf_test.rb
+++ b/test/unit/lib/redmine/export/pdf/issues_pdf_test.rb
@@ -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