VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: DNT on November 17, 2026, 16:15:49 PM

Title: Joomla 6.2: samplePDF 500 / TCPDF not found - JPATH_PLATFORM points to compat6 plugin
Post by: DNT on November 17, 2026, 16:15:49 PM
Environment: Joomla 6.2.0, VirtueMart 4.8.4, PHP 8.4 (seen on 4 shops)

Symptoms
- Frontend sample invoice (index.php?option=com_virtuemart&view=invoice&task=samplePDF) returns HTTP 500.
- Saving the vendor shows "TCPDF library not installed" and "Fonts not found in .../plugins/behaviour/compat6/src/Extension/fonts".
- TCPDF itself is present in libraries/vendor/tecnickcom/tcpdf.

Cause
In Joomla 6 the constant JPATH_PLATFORM is no longer defined by the core but by the plugin "Behaviour - Compat6" (Joomla PR #44638). In plugins/behaviour/compat6/src/Extension/Compat6.php (line 87) it is defined as:
\defined('JPATH_PLATFORM') or \define('JPATH_PLATFORM', __DIR__);__DIR__ is now the plugin folder, not /libraries as in Joomla 4/5.

VirtueMart uses it as library path in administrator/components/com_virtuemart/helpers/vmdefines.php:
$vmPathLibraries = JPATH_PLATFORM;so vmDefines::tcpdf() looks for /vendor/tecnickcom/tcpdf/tcpdf.php inside the compat6 plugin folder and fails.

Workaround (tested, samplePDF returns a PDF again)
$vmPathLibraries = \defined('JPATH_LIBRARIES') ? JPATH_LIBRARIES : JPATH_PLATFORM;JPATH_LIBRARIES exists in all supported Joomla versions, so VirtueMart could use it directly.

I will also report the JPATH_PLATFORM value to the Joomla project, as other extensions that rely on it will have the same problem.