Problem with generating PDFs in Joomla 5

Trembowiecki

Active Member
Hi, I just wanted to ask if you can replicate this problem: I try to generate PDF in Fabrik form and all I get is this error:

There is no "template.cassiopeia.ltr" asset of a "preset" type in the registry.

When I enable debugging I get this:

# Function Location
1 () JROOT/libraries/src/WebAsset/WebAssetRegistry.php:135
2 Joomla\CMS\WebAsset\WebAssetRegistry->get() JROOT/libraries/src/WebAsset/WebAssetManager.php:263
3 Joomla\CMS\WebAsset\WebAssetManager->useAsset() JROOT/libraries/src/WebAsset/WebAssetManager.php:197
4 Joomla\CMS\WebAsset\WebAssetManager->__call() JROOT/templates/cassiopeia/component.php:50
5 require() JROOT/libraries/src/Document/HtmlDocument.php:731
6 Joomla\CMS\Document\HtmlDocument->_loadTemplate() JROOT/libraries/src/Document/HtmlDocument.php:785
7 Joomla\CMS\Document\HtmlDocument->_fetchTemplate() JROOT/libraries/src/Document/HtmlDocument.php:622
8 Joomla\CMS\Document\HtmlDocument->parse() JROOT/libraries/src/Application/CMSApplication.php:1057
9 Joomla\CMS\Application\CMSApplication->render() JROOT/libraries/src/Application/SiteApplication.php:732
10 Joomla\CMS\Application\SiteApplication->render() JROOT/libraries/src/Application/CMSApplication.php:311
11 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:58
12 require_once() JROOT/index.php:32

PHP 8.2.13, Joomla 5.0.1, Fabrik 4.0 Zeta, fresh installation, template: Cassiopeia.

UPDATE: The same happens in my Joomla 4 installation. Changing PHP to 8.1.x doesn't fix the problem either. This is getting serious.

UPDATE 2: The details view works like it should. It's just this '?format=pdf' suffix makes go everything South.
 
Last edited:
Alright, some more info: the above situation happened when I used child template.

Regarding Joomla4: when I switched to parent template, PDFs suddenly started to work.

Regarding Joomla5: when I switched to parent template, PDFs still don't work, but the error looks totally different:

Argument 'document' of event onBeforeCompileHead is required but has not been provided

# Function Location
1 () JROOT/libraries/src/Event/Application/ApplicationDocumentEvent.php:38
2 Joomla\CMS\Event\Application\ApplicationDocumentEvent->__construct() JROOT/libraries/src/Application/EventAware.php:106
3 Joomla\CMS\Application\WebApplication->triggerEvent() JROOT/libraries/fabrik/fabrik/fabrik/Document/Renderer/Pdf/HeadRenderer.php:72
4 Fabrik\Document\Renderer\Pdf\HeadRenderer->fetchHead() JROOT/libraries/fabrik/fabrik/fabrik/Document/Renderer/Pdf/HeadRenderer.php:43
5 Fabrik\Document\Renderer\Pdf\HeadRenderer->render() JROOT/libraries/src/Document/HtmlDocument.php:575
6 Joomla\CMS\Document\HtmlDocument->getBuffer() JROOT/libraries/fabrik/fabrik/fabrik/Document/PdfDocument.php:340
7 Fabrik\Document\PdfDocument->getBuffer() JROOT/libraries/src/Document/HtmlDocument.php:894
8 Joomla\CMS\Document\HtmlDocument->_renderTemplate() JROOT/libraries/src/Document/HtmlDocument.php:647
9 Joomla\CMS\Document\HtmlDocument->render() JROOT/libraries/fabrik/fabrik/fabrik/Document/PdfDocument.php:267
10 Fabrik\Document\PdfDocument->render() JROOT/libraries/src/Application/CMSApplication.php:1073
11 Joomla\CMS\Application\CMSApplication->render() JROOT/libraries/src/Application/SiteApplication.php:732
12 Joomla\CMS\Application\SiteApplication->render() JROOT/libraries/src/Application/CMSApplication.php:311
13 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:58
14 require_once() JROOT/index.php:32
 
Last edited:
Issues with child templates had been reported already for F4/J!4 somewhere (won't be fixed for now)

Can you try to change in libraries\fabrik\fabrik\fabrik\Document\Renderer\Pdf\HeadRenderer.php line 72 to

$app->getDispatcher()->dispatch('onBeforeCompileHead'); //instead of $app->triggerEvent('onBeforeCompileHead');


The correspondending fix for "partial" (ajax forms, advanced search) is here
https://fabrikar.com/forums/index.p...work-with-fabrik-4-0-zeta-and-joomla-5.54204/
 
We librarians from public libraries have to collect every penny for Christmas (guess why), but I swear I'll donate after it.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top