Skip to main content

PDFSerial closes Joomla output buffer during checkout

More
3 weeks 5 days ago - 3 weeks 5 days 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:
Code:
plugins/hikaserial/pdfserial/pdfserial.php
In generatePdf() there is:
Code:
ob_get_clean();
near the end of the function, but there is no corresponding ob_start() anywhere in pdfserial.php.

I tested adding:
Code:
ob_start();
near the beginning of generatePdf(), directly after:
Code:
$pdfLib = hikaserial::get('inc.pdf'); if(empty($pdfLib)) return false;
So the relevant part is now:
Code:
$pdfLib = hikaserial::get('inc.pdf'); if(empty($pdfLib)) return false; ob_start();
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
Last edit: 3 weeks 5 days ago by Jerome. Reason: add [code] tags

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #373512 by Jerome
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,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.244 seconds
Powered by Kunena Forum