Opened 3 years ago

Closed 18 months ago

#11927 closed Bug/Something is broken (fixed)

Fatal error while trying to create a Thank You letter pdf in civicrm

Reported by: Webmaster of Leftforum Owned by: Jamie McClelland
Priority: High Component: Tech
Keywords: Cc: marcus@…
Sensitive: no

Description

Hello,

we want to change the way we Thank our donors and want to use civicrm more for that. Civi provides a way to send out Thank You emails and also creates a pdf which we want to send out via snail mail.

It allows to use tokens, for names, address and the contribution ammount.

However I tried it out a bit but after hitting the "Make Thank-You Letter" button in civi the browser worked a long while but than I got this message:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 79 bytes) in /home/members/leftforum/sites/conference.leftforum.org/web/sites/all/modules/civicrm/vendor/dompdf/dompdf/include/style.cls.php on line 445

Is there a way to fix this or can't we use this pdf making function?

greetings and best, Marcus

Change History (12)

comment:1 Changed 3 years ago by Webmaster of Leftforum

Resolution: fixed
Status: newclosed
Last edited 3 years ago by Webmaster of Leftforum (previous) (diff)

comment:2 Changed 3 years ago by Webmaster of Leftforum

Resolution: fixed
Status: closedassigned

comment:3 Changed 3 years ago by Webmaster of Leftforum

Owner: set to Webmaster of Leftforum
Priority: MediumHigh

comment:4 Changed 3 years ago by JaimeV

Owner: changed from Webmaster of Leftforum to https://id.mayfirst.org/jaime

Is this still an issue? I saw you'd marked the ticket as fixed before.

I've just increased the memory limit for your site's php processes by changing our custom php.ini file

You can access this yourself with these instructions. https://support.mayfirst.org/wiki/faq/server/change-php-ini-settings

Can you try again?

comment:5 Changed 3 years ago by Webmaster of Leftforum

No it is not working. I pressed "Make-Thank-You-Letter" button 15minutes ago and the computer is still working...

comment:6 Changed 3 years ago by JaimeV

Owner: changed from https://id.mayfirst.org/jaime to Jamie McClelland

Let's get jamie's input on this.

comment:7 Changed 3 years ago by Webmaster of Leftforum

Okay now I got this:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 512 bytes) in /home/members/leftforum/sites/conference.leftforum.org/web/sites/all/modules/civicrm/vendor/dompdf/dompdf/include/text_frame_reflower.cls.php(376) : runtime-created function on line 1

What is the maximum of memory we can put in this php.ini?

comment:8 Changed 3 years ago by JaimeV

I've set it to 128MB. Historically anytime we set the allowed memory for a php process that high and it still doesn't work, the problem is in the cms software itself but I think jamie may have more suggestions.

comment:9 Changed 3 years ago by Webmaster of Leftforum

The problem still is their. It looks it is the dompdf module, which crashes often

I found a workaround in a forum they suggest to install wkhtmltopdf

https://forum.civicrm.org/index.php?topic=23107.msg103220#msg103220

Maybe we can try that and test if it works then?

comment:10 Changed 3 years ago by JaimeV

I just talked to jamie and he suggested we could try increasing your memory again. He said he's run into the same problem, as the function you are using attempts to print the pdf letters for the entire list of contacts at once. He also suggested you might try limiting the range of contacts and do them incrementally in groups.

comment:11 Changed 3 years ago by Webmaster of Leftforum

in civi I used "Find contributions" and than I selected one, and selected from the "actions" dropdown menu the "Thank-You-Letters-For-Contribution" which I hoped will just create this one thank you letter.

Before that I created the template of that letter, this is being done in "Mailings" and then "Message Templates". Those templates are in HTML, one can put in tokens (for name, address, contirbution ammount etc.). The first template I made had all the tokens and HTML which included a 2*2 table and code for fonts, size etc..

I read in forums that this stack overflow by dompdf could be happening if the html is to rich in information. So I created a template without tokens. Same result, and than I reduced a little the html code, same result.

I assume it must be something with the dompdf module which seems not to function in general...

comment:12 Changed 18 months ago by Webmaster of Leftforum

Resolution: fixed
Status: assignedclosed

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.