Possible bug with pdf output and php7

ontarget

Active Member
Hi I just tried my site on php 7 previously php5.6 (using EasyApache4)
My pdf output works fine on 5.6 but results in a http 500 error using php7 can anyone replicate this?

This page isn?t working
mywebsite.com is currently unable to handle this request.

HTTP ERROR 500

Both frontend and backend on pdf Details View
 
1) Please post a screenshot of your settings on System > Global Configuration > Fabrik > List
2) Enable Fabrik PDF Debug.
3) What exact version of PHP are you using? Is it 7.0, 7.1 or 7.2?

Thanks.
 
Both PDF libs we ship (DOMPDF and MPDF) work fine with 7.1 and 7.2.

Have you updated Fabrik recently? I think the older version of DOMPDF (prior to Fabrik 3.7) may have had issues with PHP 7.

-- hugh
 
Hi sorry to re-awaken this thread but I still seem to have this issue. I have done a full git update of all the files Fabrik 3.8.1 and running Joomla3.8.11 (uncompressed them in the joomla dir) running on php7.1 - it works fine using php5.6
I am trying to out pdf from list view (backend)
Should i try to replace the dompdf files / directories directly?
This page isn’t working
website.com is currently unable to handle this request.

HTTP ERROR 500
 
Last edited:
UPDATE - As the joomla site in question has been upgraded numerous times i unzipped the latest joomla core files into my root directory to replace all the existing files.
I then did the switch to php7.1 again unfortunately the 500 error is still there.
I dont think its my custom pdf template as i tried to pdf output the list with the bootstrap template too

I turned on error reporting and got the following output
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 20480 bytes) in /home/otwddevacc/public_html/blackrockec/libraries/fabrik/vendor/dompdf/dompdf/src/Css/Style.php on line 1057

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 20480 bytes) in /home/otwddevacc/public_html/blackrockec/libraries/vendor/joomla/registry/src/Registry.php on line 89

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in Unknown on line 0
Turning on pdf debug in fabrik results in a plain view of the list.

So i increased my memory limit to 128M and re-ran the pdf on the list
I get the repeated errors
Notice: Undefined index: /home/otwddevacc/public_html/blackrockec/libraries/fabrik/vendor/dompdf/dompdf/lib/fonts\Helvetica in /home/otwddevacc/public_html/blackrockec/libraries/fabrik/vendor/dompdf/dompdf/src/Renderer/Text.php on line 104

Notice: Undefined index: /home/otwddevacc/public_html/blackrockec/libraries/fabrik/vendor/dompdf/dompdf/lib/fonts\Helvetica in /home/otwddevacc/public_html/blackrockec/libraries/fabrik/vendor/dompdf/dompdf/src/Renderer/Text.php on line 104

Notice: Undefined index: /home/otwddevacc/public_html/blackrockec/libraries/fabrik/vendor/dompdf/dompdf/lib/fonts\Helvetica in /home/otwddevacc/public_html/blackrockec/libraries/fabrik/vendor/dompdf/dompdf/src/Renderer/Text.php on line 104
Unable to stream pdf: headers already sent
Is this a common issue? Any advice please
 
Is it working with a details view (at least the old domPDF version had issues with big lists)?

The messages are addressing Helvetica.
What is your CSS font definition?
Did you try to set an other font?

Try to delete
libraries\fabrik\vendor\dompdf\dompdf\lib\fonts\dompdf_font_family_cache.php

It's only notices, so is it working if you are setting J! error reporting to standard or none?

The other possibility:
After the GitHub update you have the option to switch to mPDF.
 
Last edited:
Hi Troester - thanks for the reply.
Deleting libraries\fabrik\vendor\dompdf\dompdf\lib\fonts\dompdf_font_family_cache.php solved the issue.:)
The messages are addressing Helvetica.
What is your CSS font definition?
Did you try to set an other font?
I had added a shortened version of the error -it was actually showing all font types
I hadnt set any fonts.

There are a couple of other sites i have with this issue so i will try the same fix.
Great support thanks.
 
That's probably a legacy issue from a while back (last year some time, whenever I did the major DOMPDF update to their new Composer library). DOMPDF automatically builds that font_family_cache file if it doesn't exist, the first time you use DOMPDF. I didn't know that. So when I was testing the new library, it created that file, which wound up getting committed to our github. Which would have been OK, except that I'm working on Windows, so it got created with \ instead of / directory separators in the font paths. Which then blows up on UN*X boxes.

I removed the file prior to (I think) the 3.7 build, but anyone who updated from github before I found the problem got bitten by it.

-- hugh
 
Thanks Hugh
I just tried Troester's fix on another site - it seems you have to up the memory limit from 32M to 128M in order to get it to work - i dropped the mem to 32M again to see what errors where left:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 20480 bytes) in /home/blackrockec/public_html/tmp/Helvetica-Bold.afm.php on line 2

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 73728 bytes) in /home/blackrockec/public_html/libraries/vendor/joomla/registry/src/Registry.php on line 89

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 274432 bytes) in Unknown on line 0

So i clean the tmp dir - re-trigger pdf list -Then there is a new error:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 69632 bytes) in /home/blackrockec/public_html/libraries/fabrik/vendor/dompdf/dompdf/lib/Cpdf.php on line 2480

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 73728 bytes) in /home/blackrockec/public_html/libraries/vendor/joomla/registry/src/Registry.php on line 89

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 274432 bytes) in Unknown on line 0
Upping the mem limit to 64M allows the pdf to output again
 
Not sure if this is the same issue but I upgraded another site to F3.8.1 and J!3.8.11 and none of the lists load instead i get the error
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 20480 bytes) in /home/ecnavan/public_html/libraries/src/Log/LogEntry.php on line 116

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 176128 bytes) in /home/ecnavan/public_html/libraries/joomla/database/driver/mysqli.php on line 236

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 90112 bytes) in Unknown on line 0

Warning: Unknown: Cannot call session save handler in a recursive manner in Unknown on line 0

also
0 syntax error, unexpected ';'
/home/ecnavan/public_html/components/com_fabrik/models/element.php(3906) : eval()'d code:5
Call stack
#
Function Location
1 () JROOT/components/com_fabrik/models/element.php(3906) : eval()'d code:5
2 PlgFabrik_Element->getPhpOptions() JROOT/components/com_fabrik/models/element.php:3748
3 PlgFabrik_Element->getSubOptionValues() JROOT/components/com_fabrik/models/element.php:4821
4 PlgFabrik_Element->getLabelForValue() JROOT/components/com_fabrik/models/elementlist.php:650
5 PlgFabrik_ElementList->renderListData() JROOT/components/com_fabrik/models/list.php:1248
6 FabrikFEModelList->formatData() JROOT/components/com_fabrik/models/list.php:1022
7 FabrikFEModelList->finesseData() JROOT/components/com_fabrik/models/list.php:922
8 FabrikFEModelList->getData() JROOT/components/com_fabrik/models/list.php:699
9 FabrikFEModelList->render() JROOT/components/com_fabrik/views/list/view.base.php:418
10 FabrikViewListBase->display() JROOT/components/com_fabrik/views/list/view.html.php:41
11 FabrikViewList->display() JROOT/libraries/src/Cache/Controller/ViewController.php:102
12 Joomla\CMS\Cache\Controller\ViewController->get() JROOT/administrator/components/com_fabrik/controllers/list.php:155
13 FabrikAdminControllerList->view() JROOT/libraries/src/MVC/Controller/BaseController.php:710
14 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_fabrik/fabrik.php:87
15 require_once() JROOT/libraries/src/Component/ComponentHelper.php:382
16 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:357
17 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:101
18 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:159
19 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:195
20 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/index.php:51
 
Last edited:
I think 32MB memory is pretty low meanwhile.
There's an issue with caching and Joomla3.8.10/11
Try to disable J! caching or update from GitHub.

evaled code: is usually coming from some custom code. Did you also e.g. change your php version?

Gesendet von meinem SM-G930F mit Tapatalk
 
I think 32MB memory is pretty low meanwhile.
There's an issue with caching and Joomla3.8.10/11
Try to disable J! caching or update from GitHub.

evaled code: is usually coming from some custom code. Did you also e.g. change your php version?

Gesendet von meinem SM-G930F mit Tapatalk
Hi
J! cache is set to off.
Yes i tried changing from php5.6 to 7.1 - this is what triggered the error.
There is some php_event custom coding to for the list but i have another site with the exact same code running php7.1.
There is another list in the same site that is working with 7.1 however when i click view data it triggers the following error - there is no php_event on this list but the elements are child elements and are linked to other lists.
0 syntax error, unexpected ';'
/home/blackrockec/public_html/components/com_fabrik/models/element.php(3906) : eval()'d code:5
Call stack
#
Function Location
1 () JROOT/components/com_fabrik/models/element.php(3906) : eval()'d code:5
2 PlgFabrik_Element->getPhpOptions() JROOT/components/com_fabrik/models/element.php:3748
3 PlgFabrik_Element->getSubOptionValues() JROOT/components/com_fabrik/models/element.php:4821
4 PlgFabrik_Element->getLabelForValue() JROOT/components/com_fabrik/models/elementlist.php:650
5 PlgFabrik_ElementList->renderListData() JROOT/components/com_fabrik/models/list.php:1248
6 FabrikFEModelList->formatData() JROOT/components/com_fabrik/models/list.php:1022
7 FabrikFEModelList->finesseData() JROOT/components/com_fabrik/models/list.php:922
8 FabrikFEModelList->getData() JROOT/components/com_fabrik/models/list.php:699
9 FabrikFEModelList->render() JROOT/components/com_fabrik/views/list/view.base.php:418
10 FabrikViewListBase->display() JROOT/components/com_fabrik/views/list/view.html.php:41
11 FabrikViewList->display() JROOT/libraries/src/Cache/Controller/ViewController.php:102
12 Joomla\CMS\Cache\Controller\ViewController->get() JROOT/administrator/components/com_fabrik/controllers/list.php:155
13 FabrikAdminControllerList->view() JROOT/libraries/src/MVC/Controller/BaseController.php:710
14 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_fabrik/fabrik.php:87
15 require_once() JROOT/libraries/src/Component/ComponentHelper.php:382
16 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:357
17 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:101
18 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:159
19 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:195
20 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/index.php:51

I can take a sub out on this if required to get this fixed unless its some core issue going on.
Thanks
 
0 syntax error, unexpected ';'
/home/blackrockec/public_html/components/com_fabrik/models/element.php(3906) : eval()'d code:5
There seems to be an error in line 5
 
Hi
Here is my code
Line 5 = $event_id = {aed_reg_list2___event_id};

PHP:
$db = FabrikWorker::getDbo();  
$eb_events_table = $db->quoteName('#__eb_events');
$eb_events_id = $db->quoteName('id');
$c_fields = $db->quoteName('custom_fields');
$event_id = {aed_reg_list2___event_id};
$query = "SELECT $c_fields FROM $eb_events_table WHERE $eb_events_id = $event_id";
$db->setQuery($query);
$str = $db->loadResult();
$customFields = explode('field_hours', $str);

$matches = explode('"',$customFields[1]);
$maxHours = $matches[2] > 0 ? $matches[2] : 4 ;

$optionsHours = array();
$optionsHours[] = JHTML::_('select.option', 'NA', 'Please select' );
for ($x = 0; $x <= $maxHours; $x += 0.5 )
{
  $optionsHours[] = JHTML::_('select.option', $x, $x);
}
return $optionsHours;

It works ok in php5.6 but the minute i switch to php7.1 it breaks and I get the error described before
0 syntax error, unexpected ';'
/home/blackrockec/public_html/components/com_fabrik/models/element.php(3906) : eval()'d code:5
 
Not sure why it is working in php5.6

$event_id = {aed_reg_list2___event_id};
In case of an empty event_id this will give you
$event_id = ; --> unexpected ;

You must quote Fabrik placeholders.
So
$event_id = '{aed_reg_list2___event_id}';
$event_id = $db->quote($envent_id); //ALWAYS sanitize user inputs
or
$event_id = (int)'{aed_reg_list2___event_id}';
 
Super thanks - i had previously spotted that error and corrected it but was still getting the error - i then realised i had another element with the same name which was and i hadnt corrected the 2nd element!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top