WPIntell

Source evidence

Not working in Chrome – PHP deprecated

wp-mpdf · support · 2021-09-22T23:40:00+00:00

mixedsentiment
mediumseverity
0.85relevance
3replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

4 / 32 rows with source links

12.5% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
LS resolved
Do you know why the PDFs will create when I visit the page in Firefox or Safari, but not in Chrome? I have tried an incognito window and a regular window. Each time I get a black screen with a dialog popup that says “Error. Failed to load PDF document.” There’s a reload button, but that doesn’t do anything. I have checked the WP debug log and see the following (this is just a excerpt — there are a ton of these errors, but they all say the same thing) `[22-Sep-2021 23:37:22 UTC] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/mpdf.php on line 2349 [23-Sep-2021 00:38:23 Europe/London] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/classes/grad.php on line 955 [23-Sep-2021 00:38:23 Europe/London] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/classes/otl.php on line 3113 [23-Sep-2021 00:38:23 Europe/London] PHP Warning: A non-numeric value encountered in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/Tag.php on line 1889 [23-Sep-2021 00:38:23 Europe/London] PHP Warning: A non-numeric value encountered in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/Tag.php on line 2006 [23-Sep-2021 00:38:23 Europe/London] PHP Warning: A non-numeric value encountered in /www/harmonclaytor_930/public/wp-content/plugins/wp-mpdf/mpdf/mpdf.php on line 6387 This topic was modified 4 years, 8 months ago by LS . This topic was modified 4 years, 8 months ago by LS . I have determined that the PDF works if switch to the default mpdf theme (I was using a custom mpdf theme, which used to work, but now doesn’t). So that suggests the problem is somewhere with my code. I tried removing all my custom fields one by one, and it seems the issue is being caused by the ACF WYSIWYG field. All of my custom fields are ACF text fields, and they all work in the PDF fine. But as soon as I add the WYSIWYG field content, then I get the error. Is there something special I need to do to get this content into the PDF? If I use: get_post_meta( $post->ID, 'professional_activities', true ); I get an error. If I remove “true” I get a PDF, but the output simply says “Array” where that field content should be. Is there a way to output content from this field? (It’s just paragraph and bulleted text in that field.) Thank you. This reply was modified 4 years, 8 months ago by LS . Hey you need to check with the wordpress documentation. Alternative you can also disable the php depreciation message printing in your PHP settings that will prevent this as well. I understsand how to display the field. I do it all the time. I was just asking if there was something special I needed to do to get it display in your pdf template, as it was causing an error there. After a bunch of trial and error I was able to resolve it by just turning on caching in the mpdf settings. I have no idea why that worked, but I’ll go with that. Thank you.

Comments

3 shown
LS 2021-09-22T23:50:00+00:00

I have determined that the PDF works if switch to the default mpdf theme (I was using a custom mpdf theme, which used to work, but now doesn’t). So that suggests the problem is somewhere with my code. I tried removing all my custom fields one by one, and it seems the issue is being caused by the ACF WYSIWYG field. All of my custom fields are ACF text fields, and they all work in the PDF fine. But as soon as I add the WYSIWYG field content, then I get the error. Is there something special I need to do to get this content into the PDF? If I use: get_post_meta( $post->ID, 'professional_activities', true ); I get an error. If I remove “true” I get a PDF, but the output simply says “Array” where that field content should be. Is there a way to output content from this field? (It’s just paragraph and bulleted text in that field.) Thank you. This reply was modified 4 years, 8 months ago by LS .

fkrauthan 2021-09-23T03:24:00+00:00

Hey you need to check with the wordpress documentation. Alternative you can also disable the php depreciation message printing in your PHP settings that will prevent this as well.

LS 2021-09-23T13:25:00+00:00

I understsand how to display the field. I do it all the time. I was just asking if there was something special I needed to do to get it display in your pdf template, as it was causing an error there. After a bunch of trial and error I was able to resolve it by just turning on caching in the mpdf settings. I have no idea why that worked, but I’ll go with that. Thank you.