PDFSerial closes Joomla output buffer during checkout

  • Posts: 11
  • Thank you received: 2
  • Hikaserial Standard Hikashop Business
5 days 13 hours ago #373447

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:

plugins/hikaserial/pdfserial/pdfserial.php
In generatePdf() there is:
ob_get_clean();
near the end of the function, but there is no corresponding ob_start() anywhere in pdfserial.php.

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

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

  • Posts: 26389
  • Thank you received: 4078
  • MODERATOR
3 hours 59 minutes ago #373512

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.

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.056 seconds
Powered by Kunena Forum