EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
update barcode and qrcode libs
Yuri Kuznetsov88c9a02136f6
diff --git a/application/Espo/Tools/Pdf/Dompdf/HtmlComposer.php b/application/Espo/Tools/Pdf/Dompdf/HtmlComposer.phpindex cae0c1f456..eec5ce47b7 100644--- a/application/Espo/Tools/Pdf/Dompdf/HtmlComposer.php+++ b/application/Espo/Tools/Pdf/Dompdf/HtmlComposer.php@@ -29,6 +29,9 @@namespace Espo\Tools\Pdf\Dompdf;+use chillerlan\QRCode\Common\EccLevel;+use chillerlan\QRCode\Output\QRMarkupSVG;+use chillerlan\QRCode\Output\QROutputInterface;use Espo\Core\Htmlizer\TemplateRendererFactory;use Espo\Core\Utils\Config;use Espo\Core\Utils\Log;@@ -40,6 +43,8 @@ use Espo\Tools\Pdf\Template;use Picqer\Barcode\BarcodeGeneratorSVG;use chillerlan\QRCode\QRCode;use chillerlan\QRCode\QROptions;+use Picqer\Barcode\Exceptions\UnknownTypeException;+use RuntimeException;class HtmlComposer{@@ -265,8 +270,11 @@ class HtmlComposer$options = new QROptions();- $options->outputType = QRCode::OUTPUT_MARKUP_SVG;- $options->eccLevel = QRCode::ECC_H;+ // @todo Revise and test after updating the lib.+ /** @phpstan-ignore-next-line property.protected */+ $options->outputType = QROutputInterface::MARKUP_SVG;+ /** @phpstan-ignore-next-line property.protected */+ $options->eccLevel = EccLevel::H;$code = (new QRCode($options))->render($value);@@ -286,7 +294,11 @@ class HtmlComposer$height = $data['height'] ?? 30;$color = $data['color'] ?? '#000';- $code = (new BarcodeGeneratorSVG())->getBarcode($value, $type, 2, $height, $color);+ try {+ $code = (new BarcodeGeneratorSVG())->getBarcode($value, $type, 2, $height, $color);+ } catch (UnknownTypeException $e) {+ throw new RuntimeException("Barcode print error.", previous: $e);+ }$encoded = base64_encode($code);diff --git a/composer.json b/composer.jsonindex 874d7d4977..f8a6429fc3 100644--- a/composer.json+++ b/composer.json@@ -16,6 +16,7 @@"ext-curl": "*","ext-exif": "*","ext-pdo": "*",+ "ext-ctype": "*","psr/log": "~3","psr/http-message": "^1.0","psr/container": "^1.1",@@ -47,9 +48,8 @@"openspout/openspout": "^5.0","dompdf/dompdf": "^3.1","brick/phonenumber": "^0.5.0",- "picqer/php-barcode-generator": "^2.4",- "chillerlan/php-qrcode": "^4.4",- "ext-ctype": "*",+ "picqer/php-barcode-generator": "^3.2",+ "chillerlan/php-qrcode": "^5.0","lasserafn/php-initial-avatar-generator": "^4.4","tholu/php-cidr-match": "^0.5","league/oauth2-client": "^2.9",diff --git a/composer.lock b/composer.lockindex afa7499b1a..556259277c 100644--- a/composer.lock+++ b/composer.lock@@ -4,7 +4,7 @@"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies","This file is @generated automatically"],- "content-hash": "62ee507d0936a0b75a0515075ec292ea",+ "content-hash": "68047b8bb5fec096f3a5bae9593892bf","packages": [{"name": "async-aws/core",@@ -321,16 +321,16 @@},{"name": "chillerlan/php-qrcode",- "version": "4.4.2",+ "version": "5.0.5","source": {"type": "git","url": "https://github.com/chillerlan/php-qrcode.git",- "reference": "345ed8e4ffb56e6b3fcd9f42e3970b9026fa6ce4"+ "reference": "7b66282572fc14075c0507d74d9837dab25b38d6"},"dist": {"type": "zip",- "url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/345ed8e4ffb56e6b3fcd9f42e3970b9026fa6ce4",- "reference": "345ed8e4ffb56e6b3fcd9f42e3970b9026fa6ce4",+ "url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/7b66282572fc14075c0507d74d9837dab25b38d6",+ "reference": "7b66282572fc14075c0507d74d9837dab25b38d6","shasum": ""},"require": {@@ -339,11 +339,15 @@"php": "^7.4 || ^8.0"},"require-dev": {- "phan/phan": "^5.4.5",+ "chillerlan/php-authenticator": "^4.3.1 || ^5.2.1",+ "ext-fileinfo": "*",+ "phan/phan": "^5.5.2",+ "phpcompatibility/php-compatibility": "10.x-dev","phpmd/phpmd": "^2.15","phpunit/phpunit": "^9.6","setasign/fpdf": "^1.8.2",- "squizlabs/php_codesniffer": "^3.11"+ "slevomat/coding-standard": "^8.23.0",+ "squizlabs/php_codesniffer": "^4.0.0"},"suggest": {"chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.",@@ -353,17 +357,26 @@"type": "library","autoload": {"psr-4": {- "chillerlan\\QRCode\\": "src/"+ "chillerlan\\QRCode\\": "src"}},"notification-url": "https://packagist.org/downloads/","license": [- "MIT"+ "MIT",+ "Apache-2.0"],"authors": [{"name": "Kazuhiko Arase",- "homepage": "https://github.com/kazuhikoarase"+ "homepage": "https://github.com/kazuhikoarase/qrcode-generator"+ },+ {+ "name": "ZXing Authors",+ "homepage": "https://github.com/zxing/zxing"+ },+ {+ "name": "Ashot Khanamiryan",+ "homepage": "https://github.com/khanamiryan/php-qrcode-detector-decoder"},{"name": "Smiley",@@ -375,26 +388,29 @@"homepage": "https://github.com/chillerlan/php-qrcode/graphs/contributors"}],- "description": "A QR code generator with a user friendly API. PHP 7.4+",+ "description": "A QR Code generator and reader with a user-friendly API. PHP 7.4+","homepage": "https://github.com/chillerlan/php-qrcode","keywords": ["phpqrcode","qr","qr code",+ "qr-reader","qrcode",- "qrcode-generator"+ "qrcode-generator",+ "qrcode-reader"],"support": {+ "docs": "https://php-qrcode.readthedocs.io","issues": "https://github.com/chillerlan/php-qrcode/issues",- "source": "https://github.com/chillerlan/php-qrcode/tree/4.4.2"+ "source": "https://github.com/chillerlan/php-qrcode"},"funding": [{"url": "https://ko-fi.com/codemasher",- "type": "ko_fi"+ "type": "Ko-Fi"}],- "time": "2024-11-15T15:36:24+00:00"+ "time": "2025-11-23T23:51:44+00:00"},{"name": "chillerlan/php-settings-container",@@ -4439,21 +4455,21 @@},{"name": "picqer/php-barcode-generator",- "version": "v2.4.2",+ "version": "v3.2.3","source": {"type": "git","url": "https://github.com/picqer/php-barcode-generator.git",- "reference": "e9d39681f617705492b609fc3fc58465ef88e8fd"+ "reference": "fbb1de7454fcc8600133818bc1103abeb86479a4"},"dist": {"type": "zip",- "url": "https://api.github.com/repos/picqer/php-barcode-generator/zipball/e9d39681f617705492b609fc3fc58465ef88e8fd",- "reference": "e9d39681f617705492b609fc3fc58465ef88e8fd",+ "url": "https://api.github.com/repos/picqer/php-barcode-generator/zipball/fbb1de7454fcc8600133818bc1103abeb86479a4",+ "reference": "fbb1de7454fcc8600133818bc1103abeb86479a4","shasum": ""},"require": {"ext-mbstring": "*",- "php": "^8.1"+ "php": "^8.2"},"require-dev": {"phpstan/phpstan": "^1.10",@@ -4475,15 +4491,15 @@"LGPL-3.0-or-later"],"authors": [- {- "name": "Nicola Asuni",- "email": "[email protected]",- "homepage": "http://nicolaasuni.tecnick.com"- },{"name": "Casper Bakker","email": "[email protected]","homepage": "https://picqer.com"+ },+ {+ "name": "Nicola Asuni",+ "email": "[email protected]",+ "homepage": "http://nicolaasuni.tecnick.com"}],"description": "An easy to use, non-bloated, barcode generator in PHP. Creates SVG, PNG, JPG and HTML images from the most used 1D barcode standards.",@@ -4514,15 +4530,9 @@],"support": {"issues": "https://github.com/picqer/php-barcode-generator/issues",- "source": "https://github.com/picqer/php-barcode-generator/tree/v2.4.2"+ "source": "https://github.com/picqer/php-barcode-generator/tree/v3.2.3"},- "funding": [- {- "url": "https://github.com/casperbakker",- "type": "github"- }- ],- "time": "2024-09-18T08:09:33+00:00"+ "time": "2025-07-29T07:15:20+00:00"},{"name": "psr/cache",