From 9dd84924751b4ed3de60e58b09f3091ec0ee0cd4 Mon Sep 17 00:00:00 2001 From: minimexat Date: Mon, 23 Feb 2026 01:15:29 +0100 Subject: [PATCH] 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 Co-authored-by: Laurent Destailleur --- htdocs/admin/barcode.php | 2 ++ htdocs/barcode/printsheet.php | 1 + 2 files changed, 3 insertions(+) diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index fac4b259edd..5bc01fafe64 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -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(); diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 554d2fd61e6..b84fb80ea97 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -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;