Skip to content
Code-Schnipsel Gruppen Projekte
Commit 4fbeb229 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

fix(phpstan): added exception handling for missing html2pdf module in OutputTemplate

In OutputTemplate.php, a check has been added to ensure the existence of the
'QUI\\HtmlToPdf\\Document' class before using it. If the class does not exist, an error message is
logged, and an exception is thrown indicating that the html2pdf module is missing. This fix is
aimed at avoiding potential errors that may occur due to the absence of the required module.
Übergeordneter 8fe7b2ed
No related branches found
No related tags found
2 Merge Requests!170Update 'next-4.x' with latest changes from 'main',!169fix(phpstan): added exception handling for missing html2pdf module in OutputTemplate
Pipeline #14763 mit Warnungen bestanden mit Phase
in 2 Minuten und 17 Sekunden
......@@ -168,6 +168,14 @@ public function getHTML(bool $preview = false): string
*/
public function getPDFDocument(): QUI\HtmlToPdf\Document
{
if (!class_exists('QUI\HtmlToPdf\Document')) {
QUI\System\Log::addError('Missing html2pdf module. Please install the html2pdf module.');
throw new QUI\Exception(
'An error has occurred. Please try again or contact support if the issue persists.'
);
}
$Locale = $this->OutputProvider::getLocale($this->entityId);
QUI::getLocale()->setTemporaryCurrent($Locale->getCurrent());
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren