FieldFormatter throwing error with tecnickcom/tc-lib-barcode 2.3

Created on 15 November 2024, about 8 hours ago

Problem/Motivation

TypeError: Com\Tecnick\Barcode\Barcode::getBarcodeObj(): Argument #3 ($width) must be of type int, string given, called in /webroot/web/modules/contrib/barcodes/src/Plugin/Field/FieldFormatter/Barcode.php on line 291 in Com\Tecnick\Barcode\Barcode->getBarcodeObj() (line 101 of/webroot/vendor/tecnickcom/tc-lib-barcode/src/Barcode.php).

Version 2.3 of tecnickcom/tc-lib-barcode updated the `getBarcodeObj` method to require integers for width and height.

Steps to reproduce

Composer require module, ensure it's downloading tecnickcom/tc-lib-barcode 2.3. Enable and configure a QR code.
Error will be thrown on display of QR code.

Proposed resolution

Cast width and height to (int) in FieldFormatter/Barcode.php::viewElements().

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States srjosh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024