Skip to content

Commit 8bc050b

Browse files
committed
Only show pdf in email send dialog if there is a a valid pdf exporter
1 parent d7c0777 commit 8bc050b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

library/Reporting/Actions/SendMail.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Icinga\Module\Reporting\Actions;
77

88
use Icinga\Application\Config;
9+
use Icinga\Application\Hook;
910
use Icinga\Application\Logger;
1011
use Icinga\Module\Pdfexport\ProvidedHook\Pdfexport;
1112
use Icinga\Module\Reporting\Hook\ActionHook;
@@ -79,7 +80,11 @@ function ($pdf) use ($mail, $name, $recipients) {
7980

8081
public function initConfigForm(Form $form, Report $report)
8182
{
82-
$types = ['pdf' => 'PDF'];
83+
$types = [];
84+
85+
if (Hook::has('Pdfexport')) {
86+
$types['pdf'] = 'PDF';
87+
}
8388

8489
if ($report->providesData()) {
8590
$types['csv'] = 'CSV';

0 commit comments

Comments
 (0)