HTTP 500 error when printing to PDF

So I’m getting an HTTP 500 error when trying to print a contract to PDF and this is what the error log is showing; however, I’m not sure what exactly to do about it. Not really a PHP developer. Just a beginner programmer. Any help would be appreciated. Thanks!

[16-Dec-2020 04:52:01 UTC] PHP Warning: require_once(custom/brainvire/AOS_PDF_Templates/generatePdf.php): failed to open stream: No such file or directory in /home/thcepbkxgq2c/public_html/portal.paraflight.aero/include/MVC/Controller/SugarController.php on line 1020
[16-Dec-2020 04:52:01 UTC] PHP Fatal error: require_once(): Failed opening required ‘custom/brainvire/AOS_PDF_Templates/generatePdf.php’ (include_path=’/home/thcepbkxgq2c/public_html/portal.paraflight.aero:/home/thcepbkxgq2c/public_html/portal.paraflight.aero/include/…:.:/opt/alt/php74/usr/share/pear’) in /home/thcepbkxgq2c/public_html/portal.paraflight.aero/include/MVC/Controller/SugarController.php on line 1020
[16-Dec-2020 04:52:05 UTC] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/thcepbkxgq2c/public_html/portal.paraflight.aero/include/Pear/Crypt_Blowfish/Blowfish.php on line 303

@thelogos

I think that mistake here:

There should be directory modules instead brainvire if you use file generatePdf.php in custom directory structure.

Hmm, I’ve never had this issue before. It sort of just came out of nowhere and I haven’t been editing any of the php files. Is there any kind of repair that I can run on this?

What do you have in this line here :point_up: ?

It could be generating the require_once target dynamically.

private function handleEntryPoint()
    {
        if (!empty($_REQUEST['entryPoint'])) {
            $this->loadMapping('entry_point_registry');
            $entryPoint = $_REQUEST['entryPoint'];

            if (!empty($this->entry_point_registry[$entryPoint])) {
                require_once($this->entry_point_registry[$entryPoint]['file']); 
                $this->_processed = true;
                $this->view = '';
            }
        }
    }

// require_once($this->entry_point_registry[$entryPoint][‘file’]);

… is line 1020.

That is referencing

include/MVC/Controller/entry_point_registry.php,

entry generatePdf. Normally the value there is

'generatePdf' => array('file' => 'modules/AOS_PDF_Templates/generatePdf.php' , 'auth' => true),

But you probably have something overriding that, have a look at how this works in

and then go look for files in your custom module dir. Of course, if they were made by Module builder and studio, they should be correctly named, but maybe you’re hitting a bug…

‘generatePdf’ => array(‘file’ => ‘modules/AOS_PDF_Templates/generatePdf.php’ , ‘auth’ => true)

is what exists there as well.

I know what this is related to at this point. An extension author recently (a few months ago. I haven’t been working on this site recently) logged in to fix my eSignature plugin that they authored and somewhere along the way the PDF Template generate function started pointing to inside one of the folders from their custom module, which existed as a folder named brainvire inside of custom. Now not really sure what has happened.

So I got it figured out just for future reference. The eSignature extension, which had expired, was causing a bug in the PDF template mapping, because the eSignature was one of the fields in the template. After removing the eSignature field from the module completely, the print as PDF feature started working again.

Also thanks so much for your help. I’m glad to start giving back as soon as I’m able XD

1 Like