QR code: fatal error when using PDFSerial - HikaSerial plugin
- Frank.Oehlen
-
Topic Author
- Offline
Less
More
8 years 10 months ago #282059
by Frank.Oehlen
-- url of the page with the problem -- : stattgarde.de
-- HikaShop version -- : 3.2.1
-- HikaSerial version -- : 2.0.0
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6
Hi!
I tried to configurate the PDFSerial. There is no problem to integrate the serialnumber or the customers name. But I do have problems with integrating the QR code. I do use the dynamic text (like I do with the AttachSerial) and set it to "QR Code" into the field below I copied the following:
stattgarde.de/index.php?option=com_hikas...k=consume&hikaserial [serial_data]={serial.serial_data}&hikaserial[format]=html&tmpl=component
When I set the order on "shipped" to create the email with the PNG and PDF I get the following error:
Fatal error: Cannot redeclare class QRcode in /homepages/36/d78750134/htdocs/relaunch_2017/joomla3x/administrator/components/com_hikaserial/inc/tcpdf/include/barcodes/qrcode.php on line 100
What might be the mistake?
When I chance it to "barcode" it works. But I do need an QRcode.....
Regards,
Frank
-- HikaShop version -- : 3.2.1
-- HikaSerial version -- : 2.0.0
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6
Hi!
I tried to configurate the PDFSerial. There is no problem to integrate the serialnumber or the customers name. But I do have problems with integrating the QR code. I do use the dynamic text (like I do with the AttachSerial) and set it to "QR Code" into the field below I copied the following:
stattgarde.de/index.php?option=com_hikas...k=consume&hikaserial [serial_data]={serial.serial_data}&hikaserial[format]=html&tmpl=component
When I set the order on "shipped" to create the email with the PNG and PDF I get the following error:
Fatal error: Cannot redeclare class QRcode in /homepages/36/d78750134/htdocs/relaunch_2017/joomla3x/administrator/components/com_hikaserial/inc/tcpdf/include/barcodes/qrcode.php on line 100
What might be the mistake?
When I chance it to "barcode" it works. But I do need an QRcode.....
Regards,
Frank
Please Log in or Create an account to join the conversation.
8 years 10 months ago #282061
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic QR code: fatal error when using PDFSerial - HikaSerial plugin
Hello,
Indeed if you're using "attach serial" and "pdf serial" in the same time ; you will got a conflict between "PHPQRCode" and "TCPDF".
Unfortunately, TCPDF created a class named "QRCode" based on the lib "PHPQRCode" but with a lot of modifications.
Both lib are using the same name for their classes and these classes are not compatible.
So for the moment you should not use both libs in the same time.
And I will see what I can do to avoid that ; since I do not like to modify official libs because it makes the updates a living hell.
Regards,
Indeed if you're using "attach serial" and "pdf serial" in the same time ; you will got a conflict between "PHPQRCode" and "TCPDF".
Unfortunately, TCPDF created a class named "QRCode" based on the lib "PHPQRCode" but with a lot of modifications.
Both lib are using the same name for their classes and these classes are not compatible.
So for the moment you should not use both libs in the same time.
And I will see what I can do to avoid that ; since I do not like to modify official libs because it makes the updates a living hell.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
- Frank.Oehlen
-
Topic Author
- Offline
8 years 10 months ago - 8 years 10 months ago #282094
by Frank.Oehlen
Replied by Frank.Oehlen on topic QR code: fatal error when using PDFSerial - HikaSerial plugin
Hi Jerome!
Thanks for your reply! It's a pitty that it will not work propper...
I know that changing official thinks makes updating not that comfortable
Never the less - would it work, if the class QRcode would be renamed? Even if the file has to be changed very time an update has been done.... It might be a silly question for you - but it there might be a "work around" I would prefer that....
))))
Regards,
Frank
Thanks for your reply! It's a pitty that it will not work propper...
I know that changing official thinks makes updating not that comfortable
Never the less - would it work, if the class QRcode would be renamed? Even if the file has to be changed very time an update has been done.... It might be a silly question for you - but it there might be a "work around" I would prefer that....
Regards,
Frank
Last edit: 8 years 10 months ago by Frank.Oehlen.
Please Log in or Create an account to join the conversation.
8 years 10 months ago #282103
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic QR code: fatal error when using PDFSerial - HikaSerial plugin
Hello,
Well, one solution would be to add that line
At the very beginning of every file in the "inc/phpqrcode/" folder.
Then in the "inc/qrcode.php" file use
And
To right use the namespace for the checks.
And I think it should avoid your issue.
For what I could see, there is no special usage of external classes in the lib PHPQRCode so, it should not require extra modification to handle the root namespace (but I can't be entirely sure without a lot of tests).
Regards,
Well, one solution would be to add that line
Code:
namespace hikaserial\lib\phpQRCode;
Then in the "inc/qrcode.php" file use
Code:
if(!class_exists('hikaserial\lib\phpQRCode\QRencode'))
Code:
$this->factory = hikaserial\lib\phpQRCode\QRencode::factory($level, $pixelPerPoint, $outerFrame);
And I think it should avoid your issue.
For what I could see, there is no special usage of external classes in the lib PHPQRCode so, it should not require extra modification to handle the root namespace (but I can't be entirely sure without a lot of tests).
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.186 seconds