Need help with Joomla? We are available for hire to help with Joomla customization, upgrades, maintenance, and custom development.
Explore our services

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

  • Christoph
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 months 3 weeks ago - 9 months 3 weeks 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: 9 months 3 weeks ago by Christoph.

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

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
9 months 3 weeks 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