From 3edca906dbdf1be6ac81d6408755e5d94ad05a90 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 24 Mar 2020 12:17:56 +0000 Subject: [PATCH] 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 --- lib/redmine/export/pdf/issues_pdf_helper.rb | 2 +- test/unit/lib/redmine/export/pdf/issues_pdf_test.rb | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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 -- 2.39.5