restezconnectes / send-pdf-for-contact-form-7

Send the PDF for Contact Form 7 plugin will allow you to recover the data yourself via your form to insert them into a PDF built and prepared by you.
https://restezconnectes.fr/tutoriel-wordpress-lextension-send-pdf-for-contact-form-7/
GNU General Public License v3.0
15 stars 17 forks source link

fix: Handle Type Error in send-pdf.php #54

Closed elhaddajiOtmane closed 10 months ago

elhaddajiOtmane commented 11 months ago

this is my logfile ```

1 {main}

thrown in /var/www/vhosts/mytraitement.com/httpdocs/wp-content/plugins/send-pdf-for-contact-form-7-/classes/send-pdf.php on line 1202 [20-Nov-2023 09:09:51 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /var/www/vhosts/mytraitement.com/httpdocs/wp-content/plugins/send-pdf-for-contact-form-7-/classes/send-pdf.php:1202

restezconnectes commented 11 months ago

Hi!

I have adding your code like this: if (isset($meta_values['pdf-name']) && is_string($meta_values['pdf-name'])) { $singleNamePDF = esc_html(sanitize_title($meta_values['pdf-name'])); } else { // Handle the error or set a default value $singleNamePDF = 'document-pdf'; }

Thanks

elhaddajiOtmane commented 11 months ago

thank u i want to ask please if there is a way to send html in the pdf i want to send html list

Screenshot 2023-11-21 100428

i want to send make it like this xx

restezconnectes commented 11 months ago

Bonjour,

De façon dynamique ou juste une liste en dur ?

Vous pouvez utiliser n'importe quelle balise HTML pour construire votre PDF.

Cordialement

elhaddajiOtmane commented 10 months ago

@restezconnectes merci, j'ai utilisé un plugin appelé cf7-conditional-fields pour faire ça