Comments (3)
Bonjour @chrishablet
Je me permets d'intervenir dans l'exposé de votre problème afin de savoir si vous lui avez trouvé une issue ?
Je rencontre le même type de message d'erreur :
[2024-03-18 17:21:49] glpiphplog.CRITICAL: *** Uncaught Exception Error: Call to undefined method QRcode::png() in /var/www/glpi-10.0.14/plugins/barcode/inc/qrcode.class.php at line 159
Backtrace :
plugins/barcode/inc/qrcode.class.php:381 PluginBarcodeQRcode->generateQRcode()
src/MassiveAction.php:1420 PluginBarcodeQRcode::processMassiveActionsForOneItemtype()
src/MassiveAction.php:1398 MassiveAction->processForSeveralItemtypes()
front/massiveaction.php:62 MassiveAction->process()
public/index.php:82 require()
Voici, le contenu de la ligne 159 de ce fichier "barcode/inc/qrcode.class.php" :
QRcode::png($codeContents, GLPI_PLUGIN_DOC_DIR.'/barcode/tmp'.$rand.'-'.$number.'.png', QR_ECLEVEL_L, 4);
Il s'avère que, après quelques recherches, je trouve la méthode QRcode::png dans le fichier suivant :
- barcode/vendor/deltalab/phpqrcode/qrencode.php (ligne 283)
Dès lors que l'erreur est "Call to undefined method QRcode::png()", cela signifie que le fichier barcode/vendor/deltalab/phpqrcode/qrencode.php n'a pas été chargé par le ClassLoader.
Je confirme l'erreur puisque juste avant le chargement de la méthode QRcode::png(), j'ai invoqué un test du type "if (!class_exists('QRcode', false)) {..." et cette condition est VRAI.
Donc, question : comment fonctionne le chargement des fichiers de classe de type "vendor" avec les plugins GLPI ?
from barcode.
For what it is worth ... Decided to go a different way ... The code in question is pretty old (2010 I believe). I just used chillerlan/php-qrcode as a drop-in replacement.
Just ran the composer for it and problem solved...
composer require chillerlan/php-qrcode
Using GLPI through hosting and a cpanel install and got a little tired of looking for needles in haystacks to get all the tidbits working correctly.
from barcode.
I close this monologue, hoping that it will be useful to other users of the GLPI application.
WARNING: On your GLPI 10.0.x instance, if you use the PDF (version 3.0.0) and Barcode (version 2.7.1) plugins together, be aware that Barcode will not work because the autoload function of the external "vendor" classes will give preference to the external classes of the PDF plugin rather than to those of the Barcode plugin.
This results in an incompatibility causing the error:
CRITICAL: *** Uncaught Exception Error: Call to undefined method QRcode::png() in /var/www/glpi-10.0.14/plugins/barcode/inc/qrcode.class.php at line 159
For the moment, I have decided to deactivate the PDF plugin which does not necessarily meet a need (unlike printing QR codes).
This does not change the fact that there is a compartmentalization defect with the GLPI (Core) classLoader, making certain plugins incompatible when other plugins are present.
#-------- Français -----------
Je clôture ce monologue, espérant qu'il sera utile à d'autres usagers de l'application GLPI.
ATTENTION : Sur votre instance de GLPI 10.0.x, si vous utilisez conjointement les plugins PDF (version 3.0.0) et Barcode (version 2.7.1), sachez que Barcode ne fonctionnera pas car la fonction autoload des classes externes "vendor" accordera la préférence aux classes externes du plugin PDF plutôt qu'aux classes externes du plugin Barcode.
Il en résulte une incompatibilité provoquant l'erreur :
CRITICAL: *** Uncaught Exception Error: Call to undefined method QRcode::png() in /var/www/glpi-10.0.14/plugins/barcode/inc/qrcode.class.php at line 159
Pour le moment, je me suis contacté de désactiver le plugin PDF qui ne répond pas nécessairement à un besoin (au contraire de l'impression des QRCode).
Cela n'enlève rien à un défaut de cloisonnement avec le classLoader de GLPI (Core) rendant, de facto, certains plugins incompatible quand d'autres plugins sont présents.
from barcode.
Related Issues (20)
- error blank barcode
- barcode print the name HOT 1
- No entry found HOT 1
- building Codes failes HOT 1
- Save generated qr/barcode and link it to the asset HOT 1
- Add QRCode Information HOT 3
- Logo not display qr code and barcode HOT 1
- How to save presets print ? HOT 1
- Pagination
- Problemas al generar códigos QR y de barras.
- Display on label depends on integration in QRcode
- error when trying to install the barcode plugin
- [Label Size]
- How to Remove Page Number (Label Printer) HOT 1
- Glpi 10.0.11 After installtion unable to registation
- Feature Request
- barecode scanning
- Value only, without description field
- Genero qr
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from barcode.