- Posts: 11
- Thank you received: 2
PDFSerial closes Joomla output buffer during checkout
- thomas.eilers@gfse.org
-
Topic Author
- Offline
Less
More
6 days 6 hours ago - 6 days 2 hours ago #373447
by thomas.eilers@gfse.org
Hello,
I found another issue related to HikaSerial PDFSerial.
For orders with a HikaSerial PDF ticket, the HikaShop checkout completion message was rendered above the Joomla template/header instead of inside the normal component area.
A normal HikaShop book order without HikaSerial was displayed correctly.
I traced this to:
In generatePdf() there is:
near the end of the function, but there is no corresponding ob_start() anywhere in pdfserial.php.
I tested adding:
near the beginning of generatePdf(), directly after:
So the relevant part is now:
With this change:
the HikaShop completion message is again rendered correctly inside the Joomla template,
the PDF ticket is still generated correctly,
the ticket is still attached to the email.
Without this ob_start(), it looks like ob_get_clean() can close an output buffer belonging to Joomla/HikaShop.
The difference is reproducible:
normal book order without HikaSerial → page correct
event order with PDFSerial → checkout message above Joomla header
same event order after adding ob_start() → page correct
Could you please check whether generatePdf() should create its own output buffer before calling ob_get_clean()?
Best regards,
Thomas
I found another issue related to HikaSerial PDFSerial.
For orders with a HikaSerial PDF ticket, the HikaShop checkout completion message was rendered above the Joomla template/header instead of inside the normal component area.
A normal HikaShop book order without HikaSerial was displayed correctly.
I traced this to:
Code:
plugins/hikaserial/pdfserial/pdfserial.php
Code:
ob_get_clean();
I tested adding:
Code:
ob_start();
Code:
$pdfLib = hikaserial::get('inc.pdf');
if(empty($pdfLib))
return false;
Code:
$pdfLib = hikaserial::get('inc.pdf');
if(empty($pdfLib))
return false;
ob_start();
the HikaShop completion message is again rendered correctly inside the Joomla template,
the PDF ticket is still generated correctly,
the ticket is still attached to the email.
Without this ob_start(), it looks like ob_get_clean() can close an output buffer belonging to Joomla/HikaShop.
The difference is reproducible:
normal book order without HikaSerial → page correct
event order with PDFSerial → checkout message above Joomla header
same event order after adding ob_start() → page correct
Could you please check whether generatePdf() should create its own output buffer before calling ob_get_clean()?
Best regards,
Thomas
Last edit: 6 days 2 hours ago by Jerome. Reason: add [code] tags
Please Log in or Create an account to join the conversation.
20 hours 39 minutes ago #373512
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 PDFSerial closes Joomla output buffer during checkout
Hello,
Thank you for your feedback and sorry for the very late reply.
The "ob_get_clean()" is a relic of the attachserial plugin ; but the PDF library do not perform direct output of the file.
The addition of "ob_start()" is a possible solution ; but you should also be able to remove the "ob_get_clean()" too.
In the next release, it will be removed.
Regards,
Thank you for your feedback and sorry for the very late reply.
The "ob_get_clean()" is a relic of the attachserial plugin ; but the PDF library do not perform direct output of the file.
The addition of "ob_start()" is a possible solution ; but you should also be able to remove the "ob_get_clean()" too.
In the next release, it will be removed.
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.176 seconds