mirror of
https://github.com/redmine/redmine.git
synced 2025-11-08 14:26:04 +01:00
Exporting issue as PDF fails when the issue has private journal (#32858).
Patch by Kouhei Sutou. git-svn-id: http://svn.redmine.org/redmine/trunk@19458 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -212,7 +212,7 @@ module Redmine
|
|||||||
assoc[:journals].each do |journal|
|
assoc[:journals].each do |journal|
|
||||||
pdf.SetFontStyle('B',8)
|
pdf.SetFontStyle('B',8)
|
||||||
title = "##{journal.indice} - #{format_time(journal.created_on)} - #{journal.user}"
|
title = "##{journal.indice} - #{format_time(journal.created_on)} - #{journal.user}"
|
||||||
title << " (#{l(:field_private_notes)})" if journal.private_notes?
|
title += " (#{l(:field_private_notes)})" if journal.private_notes?
|
||||||
pdf.RDMCell(190,5, title)
|
pdf.RDMCell(190,5, title)
|
||||||
pdf.ln
|
pdf.ln
|
||||||
pdf.SetFontStyle('I',8)
|
pdf.SetFontStyle('I',8)
|
||||||
|
|||||||
@@ -2738,6 +2738,26 @@ class IssuesControllerTest < Redmine::ControllerTest
|
|||||||
assert @response.body.starts_with?('%PDF')
|
assert @response.body.starts_with?('%PDF')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_show_export_to_pdf_with_private_journal
|
||||||
|
Journal.create!(
|
||||||
|
:journalized => Issue.find(1),
|
||||||
|
:notes => 'Private notes',
|
||||||
|
:private_notes => true,
|
||||||
|
:user_id => 3
|
||||||
|
)
|
||||||
|
@request.session[:user_id] = 3
|
||||||
|
get(
|
||||||
|
:show,
|
||||||
|
:params => {
|
||||||
|
:id => 1,
|
||||||
|
:format => 'pdf'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
assert_response :success
|
||||||
|
assert_equal 'application/pdf', @response.content_type
|
||||||
|
assert @response.body.starts_with?('%PDF')
|
||||||
|
end
|
||||||
|
|
||||||
def test_show_export_to_pdf_with_changesets
|
def test_show_export_to_pdf_with_changesets
|
||||||
[[100], [100, 101], [100, 101, 102]].each do |cs|
|
[[100], [100, 101], [100, 101, 102]].each do |cs|
|
||||||
issue1 = Issue.find(3)
|
issue1 = Issue.find(3)
|
||||||
|
|||||||
Reference in New Issue
Block a user