mirror of
https://github.com/redmine/redmine.git
synced 2025-11-08 06:15:59 +01:00
Fix undefined method error in issue list PDF export when export contains a custom field block column with full width layout enabled that is not part of the tracker of the exported ticket(s) (#39534).
git-svn-id: https://svn.redmine.org/redmine/trunk@22418 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -339,7 +339,7 @@ module Redmine
|
|||||||
issue.visible_custom_field_values.detect do |v|
|
issue.visible_custom_field_values.detect do |v|
|
||||||
v.custom_field_id == column.custom_field.id
|
v.custom_field_id == column.custom_field.id
|
||||||
end
|
end
|
||||||
is_html = cv.custom_field.full_text_formatting?
|
is_html = cv.custom_field.full_text_formatting? if cv
|
||||||
text = show_value(cv, is_html)
|
text = show_value(cv, is_html)
|
||||||
else
|
else
|
||||||
text = pdf_format_text issue, column.name.to_sym
|
text = pdf_format_text issue, column.name.to_sym
|
||||||
|
|||||||
@@ -1194,6 +1194,29 @@ class IssuesControllerTest < Redmine::ControllerTest
|
|||||||
assert_equal 'application/pdf', @response.media_type
|
assert_equal 'application/pdf', @response.media_type
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_index_pdf_with_query_grouped_by_full_width_text_custom_field
|
||||||
|
field = IssueCustomField.
|
||||||
|
create!(
|
||||||
|
:name => 'Long text', :field_format => 'text',
|
||||||
|
:full_width_layout => '1',
|
||||||
|
:tracker_ids => [1,3], :is_for_all => true
|
||||||
|
)
|
||||||
|
issue = Issue.find(1)
|
||||||
|
issue.custom_field_values = {field.id => 'This is a long text'}
|
||||||
|
issue.save!
|
||||||
|
|
||||||
|
get(
|
||||||
|
:index,
|
||||||
|
:params => {
|
||||||
|
:set_filter => 1,
|
||||||
|
:c => ['subject', 'description', "cf_#{field.id}"],
|
||||||
|
:format => 'pdf'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
assert_response :success
|
||||||
|
assert_equal 'application/pdf', @response.media_type
|
||||||
|
end
|
||||||
|
|
||||||
def test_index_pdf_filename_without_query
|
def test_index_pdf_filename_without_query
|
||||||
get :index, :params => {:format => 'pdf'}
|
get :index, :params => {:format => 'pdf'}
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|||||||
Reference in New Issue
Block a user