PDFSerial closes Joomla output buffer during checkout

  • Posts: 10
  • Thank you received: 2
  • Hikaserial Standard Hikashop Business
1 hour 10 minutes 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

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

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