Bug in cart module? Wrong font path when loaded outside of com_eshop

  • Christoph
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 day 22 hours ago - 1 day 22 hours ago #173681 by Christoph
Hello,

I noticed a bug in the cart module when it is displayed on non-shop pages (here in the header above a normal article (com_content).

The module throws warnings like:Warning: imagettftext(): Could not find/open font in /components/com_content/helpers/helper.php on line 7332

Cause:
In /components/com_eshop/helpers/helper.php - function processTextWatermark($sourceFile, $watermarkText, $destinationFile) (around line 7280) the font path is built with
$font = JPATH_COMPONENT . '/tcpdf/fonts/' . $watermarkFont;

But JPATH_COMPONENT always points to the current component (e.g. com_content), not to com_eshop.

So the cart module cannot find the font files when rendered outside of the shop component.Fix:

It should use the absolute path to com_eshop instead, for example:

$font = JPATH_SITE . '/components/com_eshop/tcpdf/fonts/' . $watermarkFont;

This way, the cart module will always find the correct fonts, no matter on which page it is displayed.

Or do I overlook something?

Best regards,
Chris 
Last edit: 1 day 22 hours ago by Christoph.

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

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
1 day 20 hours ago #173687 by Giang Dinh Truong
Dear Christoph,

Thank you for reporting me on this. I will check and maybe fix this issue on the next version of EShop.

Sincerely, Giang

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

Moderators: Giang Dinh Truong