projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
5d4ad9d
)
Merge pull request #19497 from eileenmcnaughton/534
author
Seamus Lee
<seamuslee001@gmail.com>
Tue, 2 Feb 2021 02:14:59 +0000
(13:14 +1100)
committer
GitHub
<noreply@github.com>
Tue, 2 Feb 2021 02:14:59 +0000
(13:14 +1100)
Fix for ReportTest when launching a pdf
CRM/Utils/PDF/Utils.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/PDF/Utils.php
b/CRM/Utils/PDF/Utils.php
index 7ea2bcf12f04152756c7f39833f0207d24fe85f2..526202cb7c1f907425d6e5f6d9bb8296d1222f99 100644
(file)
--- a/
CRM/Utils/PDF/Utils.php
+++ b/
CRM/Utils/PDF/Utils.php
@@
-193,7
+193,9
@@
class CRM_Utils_PDF_Utils {
}
// CRM-19183 remove .pdf extension from filename
$fileName = basename($fileName, ".pdf");
- if (CIVICRM_UF === 'UnitTests') {
+ if (CIVICRM_UF === 'UnitTests' && headers_sent()) {
+ // Streaming content will 'die' in unit tests unless ob_start()
+ // has been called.
throw new CRM_Core_Exception_PrematureExitException('_html2pdf_dompdf called', [
'html' => $html,
'fileName' => $fileName,