From 29aaa363b41cb66bf3566afee4ee94a6d30f5ac3 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 14 Jan 2020 10:59:01 +0100 Subject: [PATCH] Pdf: Utilize an pdfexport hook without calling `isSupported()` If it's not supported, users should disable the module. If there are multiple hooks supported at some point we need to touch this again anyways. So that should suffice for now. --- library/Icinga/File/Pdf.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/library/Icinga/File/Pdf.php b/library/Icinga/File/Pdf.php index dfe8f74d3..c0c8d116e 100644 --- a/library/Icinga/File/Pdf.php +++ b/library/Icinga/File/Pdf.php @@ -70,17 +70,14 @@ class Pdf if (Hook::has('Pdfexport')) { $pdfexport = Hook::first('Pdfexport'); + $pdfexport->streamPdfFromHtml($html, sprintf( + '%s-%s-%d', + $request->getControllerName(), + $request->getActionName(), + time() + )); - if ($pdfexport->isSupported()) { - $pdfexport->streamPdfFromHtml($html, sprintf( - '%s-%s-%d', - $request->getControllerName(), - $request->getActionName(), - time() - )); - - return; - } + return; } $options = new Options();