fix: add class existence check after failed include in barcode.php (#37297)

* fix: add class existence check after failed include in barcode.php (fixes #37249)

* fix: move continue into catch block per reviewer feedback

* fix: add continue in catch block per hregis review

* fix: replace invalid continue with $error++ in printsheet.php catch block

---------

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
minimexat 2026-02-23 01:15:29 +01:00 committed by Laurent Destailleur
parent dc29ebfb87
commit 9dd8492475
2 changed files with 3 additions and 0 deletions

View file

@ -282,6 +282,7 @@ if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') && isModEnabled('product')) {
dol_include_once($dirroot.$file.'.php');
} catch (Exception $e) {
dol_syslog($e->getMessage(), LOG_ERR);
continue;
}
$modBarCode = new $file();
@ -349,6 +350,7 @@ if (getDolGlobalString('BARCODE_USE_ON_THIRDPARTY') && isModEnabled('societe'))
dol_include_once($dirroot.$file.'.php');
} catch (Exception $e) {
dol_syslog($e->getMessage(), LOG_ERR);
continue;
}
$modBarCode = new $file();

View file

@ -301,6 +301,7 @@ if (empty($reshook)) {
$result = doc_label_pdf_create($db, $arrayofrecords, $modellabel, $outputlangs, (string) $diroutput, (string) $template, dol_sanitizeFileName($outfile));
} catch (Exception $e) {
$mesg = $langs->trans('ErrorGeneratingBarcode');
$error++;
}
$conf->global->TCPDF_THROW_ERRORS_INSTEAD_OF_DIE = $previousConf;